diff options
author | Michael Scherer <misc@mageia.org> | 2012-03-19 14:09:36 +0000 |
---|---|---|
committer | Michael Scherer <misc@mageia.org> | 2012-03-19 14:09:36 +0000 |
commit | 208a5e1569dca7bcf3b0469f349f2e2bf9768913 (patch) | |
tree | f86e70a85f505492d50d8cd1816abb1af85bf63f /modules/openldap | |
parent | b9f400f50c08d8390794cc1a76fc24ebc7f1f724 (diff) | |
download | puppet-208a5e1569dca7bcf3b0469f349f2e2bf9768913.tar puppet-208a5e1569dca7bcf3b0469f349f2e2bf9768913.tar.gz puppet-208a5e1569dca7bcf3b0469f349f2e2bf9768913.tar.bz2 puppet-208a5e1569dca7bcf3b0469f349f2e2bf9768913.tar.xz puppet-208a5e1569dca7bcf3b0469f349f2e2bf9768913.zip |
rename common to init.pp, and split off slave in a separate file
simplify the inheritence tree, since puppet-lint complain
Diffstat (limited to 'modules/openldap')
-rw-r--r-- | modules/openldap/manifests/common.pp | 30 | ||||
-rw-r--r-- | modules/openldap/manifests/init.pp | 37 | ||||
-rw-r--r-- | modules/openldap/manifests/master.pp | 2 | ||||
-rw-r--r-- | modules/openldap/manifests/slave.pp | 19 | ||||
-rw-r--r-- | modules/openldap/manifests/slave_instance.pp | 3 |
5 files changed, 44 insertions, 47 deletions
diff --git a/modules/openldap/manifests/common.pp b/modules/openldap/manifests/common.pp deleted file mode 100644 index f625f0a4..00000000 --- a/modules/openldap/manifests/common.pp +++ /dev/null @@ -1,30 +0,0 @@ -class openldap::common { - package { 'openldap-servers': } - - service { 'ldap': - subscribe => Package['openldap-servers'], - require => Openssl::Self_signed_cert["ldap.$::domain"], - } - - exec { '/etc/init.d/ldap check': - refreshonly => true, - notify => Service['ldap'], - } - - file { '/etc/ssl/openldap/': - ensure => directory, - } - - openssl::self_signed_cert{ "ldap.$::domain": - directory => '/etc/ssl/openldap/', - } - - openldap::config { - '/etc/openldap/slapd.conf': - content => ''; - '/etc/openldap/mandriva-dit-access.conf': - content => ''; - '/etc/sysconfig/ldap': - content => ''; - } -} diff --git a/modules/openldap/manifests/init.pp b/modules/openldap/manifests/init.pp index 270a6521..35455d1a 100644 --- a/modules/openldap/manifests/init.pp +++ b/modules/openldap/manifests/init.pp @@ -1,21 +1,30 @@ class openldap { - class slave($rid) inherits common { + package { 'openldap-servers': } - @@openldap::exported_slave { $rid: } + service { 'ldap': + subscribe => Package['openldap-servers'], + require => Openssl::Self_signed_cert["ldap.$::domain"], + } - $sync_password = extlookup("ldap_syncuser-$hostname",'x') - - # same access rights as master - Openldap::Config['/etc/openldap/mandriva-dit-access.conf'] { - content => template("openldap/mandriva-dit-access.conf"), - } + exec { '/etc/init.d/ldap check': + refreshonly => true, + notify => Service['ldap'], + } - Openldap::Config['/etc/openldap/slapd.conf'] { - content => template("openldap/slapd.conf",'openldap/slapd.syncrepl.conf'), - } + file { '/etc/ssl/openldap/': + ensure => directory, + } + + openssl::self_signed_cert{ "ldap.$::domain": + directory => '/etc/ssl/openldap/', + } - Openldap::Config['/etc/sysconfig/ldap'] { - content => template("openldap/ldap.sysconfig"), - } + openldap::config { + '/etc/openldap/slapd.conf': + content => ''; + '/etc/openldap/mandriva-dit-access.conf': + content => ''; + '/etc/sysconfig/ldap': + content => ''; } } diff --git a/modules/openldap/manifests/master.pp b/modules/openldap/manifests/master.pp index d57ad029..0cc8bca6 100644 --- a/modules/openldap/manifests/master.pp +++ b/modules/openldap/manifests/master.pp @@ -1,4 +1,4 @@ -class openldap::master inherits openldap::common { +class openldap::master inherits openldap { Openldap::Config['/etc/openldap/mandriva-dit-access.conf'] { content => template('openldap/mandriva-dit-access.conf'), } diff --git a/modules/openldap/manifests/slave.pp b/modules/openldap/manifests/slave.pp new file mode 100644 index 00000000..a3559ef8 --- /dev/null +++ b/modules/openldap/manifests/slave.pp @@ -0,0 +1,19 @@ +class openldap::slave($rid) inherits openldap { + + @@openldap::exported_slave { $rid: } + + $sync_password = extlookup("ldap_syncuser-$::hostname",'x') + + # same access rights as master + Openldap::Config['/etc/openldap/mandriva-dit-access.conf'] { + content => template('openldap/mandriva-dit-access.conf'), + } + + Openldap::Config['/etc/openldap/slapd.conf'] { + content => template('openldap/slapd.conf','openldap/slapd.syncrepl.conf'), + } + + Openldap::Config['/etc/sysconfig/ldap'] { + content => template('openldap/ldap.sysconfig'), + } +} diff --git a/modules/openldap/manifests/slave_instance.pp b/modules/openldap/manifests/slave_instance.pp index a0eb71e2..a12771a3 100644 --- a/modules/openldap/manifests/slave_instance.pp +++ b/modules/openldap/manifests/slave_instance.pp @@ -1,8 +1,7 @@ # TODO create the user for sync in ldap # this define is mainly syntaxic sugar define openldap::slave_instance($rid) { - # seems the inheritance do not work as I believe - include openldap::common + include openldap class { 'openldap::slave': rid => $rid, } |