diff options
-rw-r--r-- | modules/mgapeople/manifests/init.pp | 58 | ||||
-rw-r--r-- | modules/mgapeople/templates/mgapeople.conf | 7 |
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 %> |