aboutsummaryrefslogtreecommitdiffstats
path: root/modules/mgapeople
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mageia.org>2013-02-21 23:52:45 +0000
committerNicolas Vigier <boklm@mageia.org>2013-02-21 23:52:45 +0000
commitc8a4b82d34628da92aa078edaaeb89b9ac8cadd6 (patch)
tree68a77bc219f3a589d3390bbb2b826e40b305c1fa /modules/mgapeople
parent80199d7bb89e2003df257bf9df91dd4bd6d75350 (diff)
downloadpuppet-c8a4b82d34628da92aa078edaaeb89b9ac8cadd6.tar
puppet-c8a4b82d34628da92aa078edaaeb89b9ac8cadd6.tar.gz
puppet-c8a4b82d34628da92aa078edaaeb89b9ac8cadd6.tar.bz2
puppet-c8a4b82d34628da92aa078edaaeb89b9ac8cadd6.tar.xz
puppet-c8a4b82d34628da92aa078edaaeb89b9ac8cadd6.zip
Add mgapeople module
Diffstat (limited to 'modules/mgapeople')
-rw-r--r--modules/mgapeople/manifests/init.pp58
-rw-r--r--modules/mgapeople/templates/mgapeople.conf7
2 files changed, 65 insertions, 0 deletions
diff --git a/modules/mgapeople/manifests/init.pp b/modules/mgapeople/manifests/init.pp
new file mode 100644
index 00000000..60e25b85
--- /dev/null
+++ b/modules/mgapeople/manifests/init.pp
@@ -0,0 +1,58 @@
+class mgapeople(
+ $site_name = 'people.mageia.org',
+ $groupbase = 'ou=Group,dc=mageia,dc=org',
+ $ldap_server,
+ $binddn,
+ $bindpw,
+ $vhost,
+ $vhostdir
+){
+ $mgapeople_login = 'mgapeople'
+ $bindpw_file = '/etc/mgapeople.ldapsecret'
+
+ group { $mgapeople_login:
+ ensure => present,
+ }
+
+ user { $mgapeople_login:
+ ensure => present,
+ comment => 'mgapeople user',
+ home => "/var/lib/${mgapeople_login}",
+ managehome => true,
+ gid => $mgapeople_login,
+ }
+
+ file { $bindpw_file:
+ ensure => present,
+ owner => $mgapeople_login,
+ group => $mgapeople_login,
+ mode => '0600',
+ content => $bindpw,
+ }
+
+ package { 'mgapeople':
+ ensure => installed,
+ }
+
+ file {'/etc/mgapeople.conf':
+ ensure => present,
+ owner => root,
+ group => root,
+ mode => '0644',
+ content => template('mgapeople/mgapeople.conf'),
+ require => Package['mgapeople'],
+ }
+
+ file { $vhostdir:
+ ensure => directory,
+ owner => $mgapeople_login,
+ group => $mgapeople_login,
+ mode => '0755',
+ }
+
+ apache::vhost::base { $vhost:
+ location => $vhostdir,
+ require => File[$vhostdir],
+ }
+}
+# vim: sw=2
diff --git a/modules/mgapeople/templates/mgapeople.conf b/modules/mgapeople/templates/mgapeople.conf
new file mode 100644
index 00000000..b0f1b5ff
--- /dev/null
+++ b/modules/mgapeople/templates/mgapeople.conf
@@ -0,0 +1,7 @@
+ldapserver: <%= @ldap_server %>
+binddn: <%= @binddn %>
+bindpwfile: <%= @bindpw_file %>
+groupbase: <%= @groupbase %>
+output_dir: <%= @vhostdir %>
+tmpl_dir: /usr/share/mgapeople/tmpl
+sitename: <%= @site_name %>