2013-07-11 11:21:02 -07:00
|
|
|
# Copyright 2013 Hewlett-Packard Development Company, L.P.
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
|
|
# not use this file except in compliance with the License. You may obtain
|
|
|
|
# a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
|
|
# License for the specific language governing permissions and limitations
|
|
|
|
# under the License.
|
|
|
|
#
|
|
|
|
# Class to configure cgit on a CentOS node.
|
|
|
|
#
|
|
|
|
# == Class: openstack_project::git
|
|
|
|
class openstack_project::git (
|
2013-08-19 17:10:13 -07:00
|
|
|
$vhost_name = $::fqdn,
|
2013-07-11 11:21:02 -07:00
|
|
|
$sysadmins = [],
|
2013-07-18 13:39:48 -07:00
|
|
|
$git_gerrit_ssh_key = '',
|
2013-08-05 10:24:16 -07:00
|
|
|
$ssl_cert_file_contents = '',
|
|
|
|
$ssl_key_file_contents = '',
|
|
|
|
$ssl_chain_file_contents = '',
|
2013-08-19 17:10:13 -07:00
|
|
|
$balance_git = false,
|
|
|
|
$behind_proxy = false,
|
|
|
|
$balancer_member_names = [],
|
|
|
|
$balancer_member_ips = []
|
2013-07-11 11:21:02 -07:00
|
|
|
) {
|
|
|
|
class { 'openstack_project::server':
|
2013-08-19 17:10:13 -07:00
|
|
|
iptables_public_tcp_ports => [80, 443, 4443, 8080, 9418, 29418],
|
2013-07-11 11:21:02 -07:00
|
|
|
sysadmins => $sysadmins,
|
|
|
|
}
|
|
|
|
|
2013-07-18 13:39:48 -07:00
|
|
|
include jeepyb
|
|
|
|
include pip
|
2013-07-11 11:21:02 -07:00
|
|
|
|
2013-08-07 16:28:28 -07:00
|
|
|
class { '::cgit':
|
2013-08-19 17:10:13 -07:00
|
|
|
vhost_name => $vhost_name,
|
2013-08-07 21:22:40 -07:00
|
|
|
ssl_cert_file => '/etc/pki/tls/certs/git.openstack.org.pem',
|
|
|
|
ssl_key_file => '/etc/pki/tls/private/git.openstack.org.key',
|
|
|
|
ssl_chain_file => '/etc/pki/tls/certs/intermediate.pem',
|
2013-08-05 10:24:16 -07:00
|
|
|
ssl_cert_file_contents => $ssl_cert_file_contents,
|
|
|
|
ssl_key_file_contents => $ssl_key_file_contents,
|
|
|
|
ssl_chain_file_contents => $ssl_chain_file_contents,
|
2013-08-19 17:10:13 -07:00
|
|
|
balance_git => $balance_git,
|
|
|
|
behind_proxy => $behind_proxy,
|
|
|
|
balancer_member_names => $balancer_member_names,
|
|
|
|
balancer_member_ips => $balancer_member_ips,
|
2013-08-05 10:24:16 -07:00
|
|
|
}
|
|
|
|
|
2013-07-19 11:52:31 -07:00
|
|
|
# We don't actually use these, but jeepyb requires them.
|
|
|
|
$local_git_dir = '/var/lib/git'
|
|
|
|
$ssh_project_key = ''
|
|
|
|
|
2013-07-11 11:21:02 -07:00
|
|
|
file { '/etc/cgitrc':
|
|
|
|
ensure => present,
|
|
|
|
owner => 'root',
|
|
|
|
group => 'root',
|
|
|
|
mode => '0644',
|
|
|
|
source => 'puppet:///modules/openstack_project/git/cgitrc'
|
|
|
|
}
|
|
|
|
|
|
|
|
file { '/home/cgit/.ssh/':
|
|
|
|
ensure => directory,
|
|
|
|
owner => 'cgit',
|
|
|
|
group => 'cgit',
|
|
|
|
mode => '0700',
|
|
|
|
require => User['cgit'],
|
|
|
|
}
|
|
|
|
|
2013-07-18 13:39:48 -07:00
|
|
|
file { '/home/cgit/.ssh/authorized_keys':
|
2013-07-11 11:21:02 -07:00
|
|
|
owner => 'cgit',
|
|
|
|
group => 'cgit',
|
|
|
|
mode => '0600',
|
2013-07-18 13:39:48 -07:00
|
|
|
content => $git_gerrit_ssh_key,
|
2013-07-11 11:21:02 -07:00
|
|
|
replace => true,
|
|
|
|
require => File['/home/cgit/.ssh/']
|
|
|
|
}
|
|
|
|
|
2013-07-18 13:39:48 -07:00
|
|
|
file { '/home/cgit/projects.yaml':
|
|
|
|
ensure => present,
|
|
|
|
owner => 'cgit',
|
|
|
|
group => 'cgit',
|
|
|
|
mode => '0444',
|
|
|
|
content => template('openstack_project/review.projects.yaml.erb'),
|
|
|
|
replace => true,
|
|
|
|
}
|
|
|
|
|
|
|
|
exec { 'create_cgitrepos':
|
|
|
|
command => 'create-cgitrepos',
|
|
|
|
path => '/bin:/usr/bin:/usr/local/bin',
|
|
|
|
require => File['/home/cgit/projects.yaml'],
|
|
|
|
subscribe => File['/home/cgit/projects.yaml'],
|
|
|
|
refreshonly => true,
|
|
|
|
}
|
|
|
|
|
2013-07-11 11:21:02 -07:00
|
|
|
class { 'selinux':
|
|
|
|
mode => 'enforcing'
|
|
|
|
}
|
2013-08-14 17:33:00 -07:00
|
|
|
|
|
|
|
file { '/var/www/cgit/static/openstack.png':
|
|
|
|
ensure => present,
|
|
|
|
source => 'puppet:///modules/openstack_project/openstack.png',
|
|
|
|
require => File['/var/www/cgit/static'],
|
|
|
|
}
|
|
|
|
|
|
|
|
file { '/var/www/cgit/static/favicon.ico':
|
|
|
|
ensure => present,
|
|
|
|
source => 'puppet:///modules/openstack_project/status/favicon.ico',
|
|
|
|
require => File['/var/www/cgit/static'],
|
|
|
|
}
|
|
|
|
|
|
|
|
file { '/var/www/cgit/static/openstack-page-bkg.jpg':
|
|
|
|
ensure => present,
|
|
|
|
source => 'puppet:///modules/openstack_project/openstack-page-bkg.jpg',
|
|
|
|
require => File['/var/www/cgit/static'],
|
|
|
|
}
|
|
|
|
|
|
|
|
file { '/var/www/cgit/static/openstack.css':
|
|
|
|
ensure => present,
|
|
|
|
source => 'puppet:///modules/openstack_project/git/openstack.css',
|
|
|
|
require => File['/var/www/cgit/static'],
|
|
|
|
}
|
|
|
|
|
2013-07-11 11:21:02 -07:00
|
|
|
}
|