aboutsummaryrefslogtreecommitdiffstats
path: root/modules/openldap
diff options
context:
space:
mode:
authorMichael Scherer <misc@mageia.org>2012-03-19 14:09:31 +0000
committerMichael Scherer <misc@mageia.org>2012-03-19 14:09:31 +0000
commit78ae7344a797d22336a646824761919c0b1947ba (patch)
tree2208e6a796d5b2ee7d7990f8bc99f7e42d89aa63 /modules/openldap
parent7d9fa450670b083ac96eed85916f76136c044bd4 (diff)
downloadpuppet-78ae7344a797d22336a646824761919c0b1947ba.tar
puppet-78ae7344a797d22336a646824761919c0b1947ba.tar.gz
puppet-78ae7344a797d22336a646824761919c0b1947ba.tar.bz2
puppet-78ae7344a797d22336a646824761919c0b1947ba.tar.xz
puppet-78ae7344a797d22336a646824761919c0b1947ba.zip
split most class and define from main openldap init.pp file
Diffstat (limited to 'modules/openldap')
-rw-r--r--modules/openldap/manifests/common.pp30
-rw-r--r--modules/openldap/manifests/config.pp7
-rw-r--r--modules/openldap/manifests/exported_slave.pp3
-rw-r--r--modules/openldap/manifests/init.pp54
-rw-r--r--modules/openldap/manifests/slave_instance.pp11
5 files changed, 52 insertions, 53 deletions
diff --git a/modules/openldap/manifests/common.pp b/modules/openldap/manifests/common.pp
new file mode 100644
index 00000000..f625f0a4
--- /dev/null
+++ b/modules/openldap/manifests/common.pp
@@ -0,0 +1,30 @@
+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/config.pp b/modules/openldap/manifests/config.pp
new file mode 100644
index 00000000..6f364ffc
--- /dev/null
+++ b/modules/openldap/manifests/config.pp
@@ -0,0 +1,7 @@
+define openldap::config($content) {
+ file { $name:
+ require => Package['openldap-servers'],
+ content => $content,
+ notify => Exec['/etc/init.d/ldap check'],
+ }
+}
diff --git a/modules/openldap/manifests/exported_slave.pp b/modules/openldap/manifests/exported_slave.pp
new file mode 100644
index 00000000..5b9f6b87
--- /dev/null
+++ b/modules/openldap/manifests/exported_slave.pp
@@ -0,0 +1,3 @@
+# this define is here only to be exported by slave
+# and later used by get_ldap_servers
+define openldap::exported_slave { }
diff --git a/modules/openldap/manifests/init.pp b/modules/openldap/manifests/init.pp
index 4f2c2d33..23971eb2 100644
--- a/modules/openldap/manifests/init.pp
+++ b/modules/openldap/manifests/init.pp
@@ -1,41 +1,5 @@
class openldap {
- define config($content) {
- file { $name:
- require => Package["openldap-servers"],
- content => $content,
- notify => Exec["/etc/init.d/ldap check"],
- }
- }
-
- class 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 => "";
- }
- }
-
- class master inherits common {
+ class master inherits common {
Openldap::Config['/etc/openldap/mandriva-dit-access.conf'] {
content => template("openldap/mandriva-dit-access.conf"),
}
@@ -76,22 +40,6 @@ class openldap {
}
}
- # this define is here only to be exported by slave
- # and later used by get_ldap_servers
- define exported_slave {
-
- }
-
- # TODO create the user for sync in ldap
- # syntaxic sugar
- define slave_instance($rid) {
- # seems the inheritance do not work as I believe
- include openldap::common
- class { 'openldap::slave':
- rid => $rid,
- }
- }
-
class slave($rid) inherits common {
@@openldap::exported_slave { $rid: }
diff --git a/modules/openldap/manifests/slave_instance.pp b/modules/openldap/manifests/slave_instance.pp
new file mode 100644
index 00000000..a0eb71e2
--- /dev/null
+++ b/modules/openldap/manifests/slave_instance.pp
@@ -0,0 +1,11 @@
+# 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
+ class { 'openldap::slave':
+ rid => $rid,
+ }
+}
+
+