Add cgit web service and git server
Define git.openstack.org server and deploy cgit web service with Apache on CentOS. Change-Id: Id3c7c870e25e4202915bc081454896895084f9af
This commit is contained in:
parent
c749a87233
commit
52732dd550
28
doc/source/git.rst
Normal file
28
doc/source/git.rst
Normal file
@ -0,0 +1,28 @@
|
||||
:title: Git
|
||||
|
||||
.. _git:
|
||||
|
||||
Git
|
||||
########
|
||||
|
||||
The web frontend cgit is running on git.openstack.org.
|
||||
|
||||
At a Glance
|
||||
===========
|
||||
|
||||
:Hosts:
|
||||
* http://git.openstack.org
|
||||
:Puppet:
|
||||
* :file:`modules/cgit`
|
||||
* :file:`modules/openstack_project/manifests/git.pp`
|
||||
:Projects:
|
||||
* http://git.zx2c4.com/cgit/
|
||||
:Bugs:
|
||||
* http://bugs.launchpad.net/openstack-ci
|
||||
* http://lists.zx2c4.com/mailman/listinfo/cgit
|
||||
|
||||
Overview
|
||||
========
|
||||
|
||||
Apache is running on a CentOS 6 system with the EPEL repository that includes
|
||||
the cgit packages.
|
@ -268,6 +268,14 @@ node /^elasticsearch\d*\.openstack\.org$/ {
|
||||
}
|
||||
}
|
||||
|
||||
# A CentOS machine to run cgit and git daemon.
|
||||
node 'git.openstack.org' {
|
||||
class { 'openstack_project::git':
|
||||
sysadmins => hiera('sysadmins'),
|
||||
git_gerrit_ssh_key => hiera('gerrit_ssh_rsa_pubkey_contents'),
|
||||
}
|
||||
}
|
||||
|
||||
# A machine to run ODSREG in preparation for summits.
|
||||
node 'summit.openstack.org' {
|
||||
class { 'openstack_project::summit':
|
||||
|
2
modules/cgit/files/cgit.conf
Normal file
2
modules/cgit/files/cgit.conf
Normal file
@ -0,0 +1,2 @@
|
||||
Alias /cgit-data /usr/share/cgit
|
||||
ScriptAlias /cgit /var/www/cgi-bin/cgit
|
76
modules/cgit/manifests/init.pp
Normal file
76
modules/cgit/manifests/init.pp
Normal file
@ -0,0 +1,76 @@
|
||||
# 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: cgit
|
||||
#
|
||||
class cgit {
|
||||
|
||||
include apache
|
||||
|
||||
package { [
|
||||
'cgit',
|
||||
'git-daemon',
|
||||
]:
|
||||
ensure => present,
|
||||
}
|
||||
|
||||
service { 'httpd':
|
||||
ensure => running,
|
||||
require => Package['httpd'],
|
||||
}
|
||||
|
||||
user { 'cgit':
|
||||
ensure => present,
|
||||
home => '/home/cgit',
|
||||
shell => '/bin/bash',
|
||||
gid => 'cgit',
|
||||
managehome => true,
|
||||
require => Group['cgit'],
|
||||
}
|
||||
|
||||
group { 'cgit':
|
||||
ensure => present,
|
||||
}
|
||||
|
||||
file {'/home/cgit':
|
||||
ensure => directory,
|
||||
owner => 'cgit',
|
||||
group => 'cgit',
|
||||
mode => '0755',
|
||||
require => User['cgit'],
|
||||
}
|
||||
|
||||
file { '/var/lib/git':
|
||||
ensure => directory,
|
||||
owner => 'cgit',
|
||||
group => 'cgit',
|
||||
mode => '0644',
|
||||
}
|
||||
|
||||
exec { 'restorecon -R -v /var/lib/git':
|
||||
path => '/sbin',
|
||||
subscribe => Folder['/var/lib/git']
|
||||
}
|
||||
|
||||
selboolean { 'httpd_enable_cgi':
|
||||
persistent => true,
|
||||
value => on
|
||||
}
|
||||
|
||||
file { '/etc/httpd/conf.d/cgit.conf':
|
||||
ensure => present,
|
||||
source => 'puppet:///modules/cgit/cgit.conf',
|
||||
mode => '0644'
|
||||
}
|
||||
}
|
71
modules/openstack_project/files/git/cgitrc
Normal file
71
modules/openstack_project/files/git/cgitrc
Normal file
@ -0,0 +1,71 @@
|
||||
#
|
||||
# See cgitrc(5) or /usr/share/doc/cgit-*/cgitrc.5.html for details
|
||||
#
|
||||
|
||||
# Enable caching of up to 1000 output entries
|
||||
cache-size=0
|
||||
|
||||
# Specify some default clone prefixes
|
||||
clone-prefix=git://git.openstack.org http://git.openstack.org/cgit
|
||||
|
||||
# Specify the css url
|
||||
css=/cgit-data/cgit.css
|
||||
|
||||
# Show extra links for each repository on the index page
|
||||
enable-index-links=1
|
||||
|
||||
# Enable ASCII art commit history graph on the log pages
|
||||
enable-commit-graph=1
|
||||
|
||||
# Show number of affected files per commit on the log pages
|
||||
enable-log-filecount=1
|
||||
|
||||
# Show number of added/removed lines per commit on the log pages
|
||||
enable-log-linecount=1
|
||||
|
||||
# Add a cgit favicon
|
||||
#favicon=/favicon.ico
|
||||
|
||||
# Use a custom logo
|
||||
logo=/cgit-data/cgit.png
|
||||
|
||||
# Enable statistics per week, month and quarter
|
||||
max-stats=quarter
|
||||
|
||||
# Set the title and heading of the repository index page
|
||||
root-title=OpenStack git repository browser
|
||||
|
||||
# Set a subheading for the repository index page
|
||||
#root-desc=tracking the foobar development
|
||||
|
||||
# Include some more info about this site on the index page
|
||||
#root-readme=/var/www/html/about.html
|
||||
|
||||
# Allow download of tar.gz, tar.bz2 and zip-files
|
||||
#snapshots=tar.gz tar.bz2 zip
|
||||
|
||||
##
|
||||
## List of common mimetypes
|
||||
##
|
||||
|
||||
mimetype.gif=image/gif
|
||||
mimetype.html=text/html
|
||||
mimetype.jpg=image/jpeg
|
||||
mimetype.jpeg=image/jpeg
|
||||
mimetype.pdf=application/pdf
|
||||
mimetype.png=image/png
|
||||
mimetype.svg=image/svg+xml
|
||||
|
||||
# Enable syntax highlighting (requires the highlight package)
|
||||
#source-filter=/usr/libexec/cgit/filters/syntax-highlighting.sh
|
||||
|
||||
##
|
||||
## List of repositories.
|
||||
## PS: Any repositories listed when section is unset will not be
|
||||
## displayed under a section heading
|
||||
## PPS: This list could be kept in a different file (e.g. '/etc/cgitrepos')
|
||||
## and included like this:
|
||||
## include=/etc/cgitrepos
|
||||
##
|
||||
|
||||
include=/etc/cgitrepos
|
58
modules/openstack_project/manifests/git.pp
Normal file
58
modules/openstack_project/manifests/git.pp
Normal file
@ -0,0 +1,58 @@
|
||||
# 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 (
|
||||
$sysadmins = [],
|
||||
$git_gerrit_ssh_key = $git_gerrit_ssh_key,
|
||||
$gerrit_url = 'review.openstack.org'
|
||||
) {
|
||||
class { 'openstack_project::server':
|
||||
iptables_public_tcp_ports => [80, 9418],
|
||||
sysadmins => $sysadmins,
|
||||
}
|
||||
|
||||
include cgit
|
||||
|
||||
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'],
|
||||
}
|
||||
|
||||
file { '/home/cgit/.ssh/known_hosts':
|
||||
owner => 'cgit',
|
||||
group => 'cgit',
|
||||
mode => '0600',
|
||||
content => "${gerrit_url} ${git_gerrit_ssh_key}",
|
||||
replace => true,
|
||||
require => File['/home/cgit/.ssh/']
|
||||
}
|
||||
|
||||
class { 'selinux':
|
||||
mode => 'enforcing'
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user