aboutsummaryrefslogtreecommitdiffstats
path: root/deployment/mgagit/manifests
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mageia.org>2013-06-25 16:10:21 +0000
committerNicolas Vigier <boklm@mageia.org>2013-06-25 16:10:21 +0000
commit61397108726057d45f604092a52afbdc6a548a09 (patch)
treeeac388c75104d7efe3692e03ef57647c355a4844 /deployment/mgagit/manifests
parent5e8c30538ec900dc6c389ea47899b10f1fa0b8e3 (diff)
downloadpuppet-61397108726057d45f604092a52afbdc6a548a09.tar
puppet-61397108726057d45f604092a52afbdc6a548a09.tar.gz
puppet-61397108726057d45f604092a52afbdc6a548a09.tar.bz2
puppet-61397108726057d45f604092a52afbdc6a548a09.tar.xz
puppet-61397108726057d45f604092a52afbdc6a548a09.zip
Add mgagit module
Diffstat (limited to 'deployment/mgagit/manifests')
-rw-r--r--deployment/mgagit/manifests/init.pp62
1 files changed, 62 insertions, 0 deletions
diff --git a/deployment/mgagit/manifests/init.pp b/deployment/mgagit/manifests/init.pp
new file mode 100644
index 00000000..6b346f72
--- /dev/null
+++ b/deployment/mgagit/manifests/init.pp
@@ -0,0 +1,62 @@
+class mgagit(
+ $ldap_server = 'ldap.mageia.org',
+ $binddn = 'uid=mgagit,ou=People,dc=mageia,dc=org',
+ $bindpw
+){
+ $git_login = 'git'
+ $git_homedir = "/var/lib/${git_login}"
+ $gitolite_dir = "${git_homedir}/.gitolite"
+ $gitolite_keydir = "${gitolite_dir}/keydir"
+ $gitolite_confdir = "${gitolite_dir}/conf"
+ $gitolite_conf = "${gitolite_confdir}/gitolite.conf"
+ $gitoliterc = "$git_homedir/.gitolite.rc"
+ $bindpwfile = '/etc/mgagit.secret'
+
+ package { ['mgagit', 'gitolite']:
+ ensure => installed,
+ }
+
+ group { $git_login:
+ ensure => present,
+ }
+ user { $git_login:
+ ensure => present,
+ comment => 'Git user',
+ home => $git_homedir,
+ managedhome => true,
+ git => $git_login,
+ }
+
+ file { '/etc/mgagit.conf':
+ ensure => present,
+ owner => root,
+ group => root,
+ mode => '0644',
+ content => template('mgagit/mgagit.conf'),
+ require => Package['mgagit'],
+ }
+
+ file { [$gitolite_dir, $gitolite_keydir, $gitolite_confdir]:
+ ensure => directory,
+ owner => $git_login,
+ group => $git_login,
+ mode => '0755',
+ }
+
+ file { $gitoliterc:
+ ensure => present,
+ owner => $git_login,
+ group => $git_login,
+ mode => '0644',
+ content => template('mgagit/gitolite.rc'),
+ }
+
+ file { $bindpwfile:
+ ensure => present,
+ owner => $git_login,
+ group => $git_login,
+ mode => '0600',
+ content => inline_template('<%= @bindpw %>'),
+ }
+}
+# vim: sw=2