From f0fc8b8e901ab741071ca5c15cdae6f287bbff50 Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Fri, 24 Jul 2015 14:33:06 +0200 Subject: [PATCH 1/6] Vagrant: slapd must be running, add provision hint to docs For some reason the initial ldap provisioning might fail even after ensuring that slapd is running. Yet another `vagrant provision` will fix the issue. refs #9453 --- .puppet/modules/openldap/manifests/init.pp | 2 +- doc/vagrant.md | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.puppet/modules/openldap/manifests/init.pp b/.puppet/modules/openldap/manifests/init.pp index 11cc2b42a..62b9d1e34 100644 --- a/.puppet/modules/openldap/manifests/init.pp +++ b/.puppet/modules/openldap/manifests/init.pp @@ -28,7 +28,7 @@ class openldap { exec { "slapd-schema-${schema}": command => "ldapadd -Y EXTERNAL -H ldapi:// -f /etc/openldap/schema/${schema}.ldif", group => 'root', - require => Package['openldap-servers'], + require => [ Package['openldap-servers'], Service['slapd'] ], unless => "test -n \"$(find /etc/openldap/slapd.d/cn=config/cn=schema/ -name cn={*}${schema}.ldif -print -quit)\"", user => 'root', } diff --git a/doc/vagrant.md b/doc/vagrant.md index b1b98b436..148e6aeb8 100644 --- a/doc/vagrant.md +++ b/doc/vagrant.md @@ -24,6 +24,8 @@ vagrant up > you'll download a plain CentOS base box and Vagrant will automatically > provision the environment on the first go. +If the LDAP schema import fails, rerun `vagrant provision`. + After you should be able to browse [localhost:8080/icingaweb2](http://localhost:8080/icingaweb2). ## Log into Icinga Web 2 From bba7cb14633c092a6fd5a8478f453f78489ca439 Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Fri, 24 Jul 2015 14:34:13 +0200 Subject: [PATCH 2/6] Vagrant: Use centos71 base box from icinga.org refs #9453 --- Vagrantfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index 11b5e2b9c..7d026fc83 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -22,9 +22,11 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.provision :shell, :path => ".puppet/manifests/puppet.sh" config.vm.provider :virtualbox do |v, override| - override.vm.box = "puppetlabs/centos-7.0-64-puppet" + override.vm.box = "centos-71-x64-vbox" + override.vm.box_url = "http://boxes.icinga.org/centos-71-x64-vbox.box" v.customize ["modifyvm", :id, "--memory", "1024"] + v.customize ["modifyvm", :id, "--cpus", "2"] end config.vm.provider :parallels do |p, override| From cc1b26be0ce794e58c8b7da1a8057379a6b8c66f Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Fri, 31 Jul 2015 15:56:49 +0200 Subject: [PATCH 3/6] Revert "Vagrant: slapd must be running, add provision hint to docs" This reverts commit f0fc8b8e901ab741071ca5c15cdae6f287bbff50. I'll fix this by introducing dependencies for the schema import. refs #9453 --- .puppet/modules/openldap/manifests/init.pp | 2 +- doc/vagrant.md | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.puppet/modules/openldap/manifests/init.pp b/.puppet/modules/openldap/manifests/init.pp index 62b9d1e34..11cc2b42a 100644 --- a/.puppet/modules/openldap/manifests/init.pp +++ b/.puppet/modules/openldap/manifests/init.pp @@ -28,7 +28,7 @@ class openldap { exec { "slapd-schema-${schema}": command => "ldapadd -Y EXTERNAL -H ldapi:// -f /etc/openldap/schema/${schema}.ldif", group => 'root', - require => [ Package['openldap-servers'], Service['slapd'] ], + require => Package['openldap-servers'], unless => "test -n \"$(find /etc/openldap/slapd.d/cn=config/cn=schema/ -name cn={*}${schema}.ldif -print -quit)\"", user => 'root', } diff --git a/doc/vagrant.md b/doc/vagrant.md index 148e6aeb8..b1b98b436 100644 --- a/doc/vagrant.md +++ b/doc/vagrant.md @@ -24,8 +24,6 @@ vagrant up > you'll download a plain CentOS base box and Vagrant will automatically > provision the environment on the first go. -If the LDAP schema import fails, rerun `vagrant provision`. - After you should be able to browse [localhost:8080/icingaweb2](http://localhost:8080/icingaweb2). ## Log into Icinga Web 2 From df38e127e157259ee7e2581bcc9a3376e332d501 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Fri, 31 Jul 2015 16:23:22 +0200 Subject: [PATCH 4/6] Puppet: Require php in phpd not vice versa refs #9453 --- .puppet/modules/php/manifests/init.pp | 4 +--- .puppet/modules/php/manifests/phpd.pp | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.puppet/modules/php/manifests/init.pp b/.puppet/modules/php/manifests/init.pp index 788ad5df1..d9d111b71 100644 --- a/.puppet/modules/php/manifests/init.pp +++ b/.puppet/modules/php/manifests/init.pp @@ -24,7 +24,5 @@ class php { require => Package['apache'], } - php::phpd { ['error_reporting', 'timezone', 'xdebug_settings' ]: - require => Package['php'], - } + php::phpd { ['error_reporting', 'timezone', 'xdebug_settings' ]: } } diff --git a/.puppet/modules/php/manifests/phpd.pp b/.puppet/modules/php/manifests/phpd.pp index 4d59223cb..dab28aec1 100644 --- a/.puppet/modules/php/manifests/phpd.pp +++ b/.puppet/modules/php/manifests/phpd.pp @@ -17,5 +17,6 @@ define php::phpd { file { "/etc/php.d/$name.ini": content => template("php/$name.ini.erb"), notify => Service['apache'], + require => Package['php'], } } From 9379faf9ebc0cc7a6f43a40405a688f55e17bfcd Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Fri, 31 Jul 2015 16:23:51 +0200 Subject: [PATCH 5/6] Puppet: Add openldap::schema for installing a schema refs #9453 --- .puppet/modules/openldap/manifests/schema.pp | 24 ++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .puppet/modules/openldap/manifests/schema.pp diff --git a/.puppet/modules/openldap/manifests/schema.pp b/.puppet/modules/openldap/manifests/schema.pp new file mode 100644 index 000000000..a98239379 --- /dev/null +++ b/.puppet/modules/openldap/manifests/schema.pp @@ -0,0 +1,24 @@ +# define: openldap::schema +# +# Install a schema. +# +# Parameters: +# +# Actions: +# +# Requires: +# +# Sample Usage: +# +define openldap::schema { + + include openldap + + exec { "openldap-schema-${name}": + command => "ldapadd -Y EXTERNAL -H ldapi:// -f /etc/openldap/schema/${name}.ldif", + group => 'root', + require => Service['slapd'], + unless => "test -n \"$(find /etc/openldap/slapd.d/cn=config/cn=schema/ -name cn={*}${name}.ldif -print -quit)\"", + user => 'root', + } +} From 222b91dfd1e5451b25d47a80b524fa0900faa9d9 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Fri, 31 Jul 2015 16:24:21 +0200 Subject: [PATCH 6/6] Puppet: Fix that openldap core schemas are not correctly installed on Red Hat Linux 7 refs #9453 --- .puppet/modules/openldap/manifests/init.pp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.puppet/modules/openldap/manifests/init.pp b/.puppet/modules/openldap/manifests/init.pp index 11cc2b42a..a0480632e 100644 --- a/.puppet/modules/openldap/manifests/init.pp +++ b/.puppet/modules/openldap/manifests/init.pp @@ -24,14 +24,11 @@ class openldap { } if versioncmp($::operatingsystemmajrelease, '7') >= 0 { - ['core', 'cosine', 'inetorgperson', 'nis', 'misc', 'openldap'].each |String $schema| { - exec { "slapd-schema-${schema}": - command => "ldapadd -Y EXTERNAL -H ldapi:// -f /etc/openldap/schema/${schema}.ldif", - group => 'root', - require => Package['openldap-servers'], - unless => "test -n \"$(find /etc/openldap/slapd.d/cn=config/cn=schema/ -name cn={*}${schema}.ldif -print -quit)\"", - user => 'root', - } - } + openldap::schema{ 'core': } + -> openldap::schema{ 'cosine': } + -> openldap::schema{ 'inetorgperson': } + -> openldap::schema{ 'nis': } + -> openldap::schema{ 'misc': } + -> openldap::schema{ 'openldap': } } }