From f6cc316cb1b4c3e4c8671975ff03b1651f9f4409 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20M=E4kinen?= Date: Fri, 14 Jun 2013 07:34:19 +0300 Subject: [PATCH 1/3] ldap: Style fixes. --- ldap/manifests/init.pp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/ldap/manifests/init.pp b/ldap/manifests/init.pp index 81a6e4f..51a23b7 100644 --- a/ldap/manifests/init.pp +++ b/ldap/manifests/init.pp @@ -530,16 +530,14 @@ class ldap::server { } } - if $::selinux == "true" { - selinux::manage_fcontext { "/srv/ldap(/.*)?": + selinux::manage_fcontext { "/srv/ldap(/.*)?": + type => "slapd_db_t", + before => File["/srv/ldap"], + } + if $ldap_datadir { + selinux::manage_fcontext { "${ldap_datadir}(/.*)?": type => "slapd_db_t", - before => File["/srv/ldap"], - } - if $ldap_datadir { - selinux::manage_fcontext { "${ldap_datadir}(/.*)?": - type => "slapd_db_t", - before => File[$ldap_datadir], - } + before => File[$ldap_datadir], } } From 871a98bc2a08d1ac2285630a2202bb9095d593c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20M=E4kinen?= Date: Fri, 14 Jun 2013 07:35:53 +0300 Subject: [PATCH 2/3] ldap: Removed IPv6 support from server if IPv6 is not enabled on host. --- ldap/manifests/init.pp | 2 +- ldap/{files/ldap.sysconfig => templates/ldap.sysconfig.erb} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename ldap/{files/ldap.sysconfig => templates/ldap.sysconfig.erb} (82%) diff --git a/ldap/manifests/init.pp b/ldap/manifests/init.pp index 51a23b7..5de7bbd 100644 --- a/ldap/manifests/init.pp +++ b/ldap/manifests/init.pp @@ -464,7 +464,7 @@ class ldap::server { if $::operatinsystemrelease !~ /^5\./ { file { "/etc/sysconfig/ldap": ensure => present, - source => "puppet:///modules/ldap/ldap.sysconfig", + content => template("ldap/ldap.sysconfig.erb"), mode => "0644", owner => "root", group => "root", diff --git a/ldap/files/ldap.sysconfig b/ldap/templates/ldap.sysconfig.erb similarity index 82% rename from ldap/files/ldap.sysconfig rename to ldap/templates/ldap.sysconfig.erb index a9f59e2..00ded90 100644 --- a/ldap/files/ldap.sysconfig +++ b/ldap/templates/ldap.sysconfig.erb @@ -1,5 +1,5 @@ # Options of slapd (see man slapd) -SLAPD_OPTIONS="-f /etc/openldap/slapd.conf" +SLAPD_OPTIONS="-f /etc/openldap/slapd.conf<% if @ipv6enabled == 'false' %> -4<% end %>" # At least one of SLAPD_LDAP, SLAPD_LDAPI and SLAPD_LDAPS must be set to 'yes'! # From a573e6565eea6214c089ab69fb2ead65bf3d3b3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20M=E4kinen?= Date: Fri, 14 Jun 2013 09:16:27 +0300 Subject: [PATCH 3/3] ntpd: Fix error "getaddrinfo: "::1" invalid host address" when IPv6 is disabled. --- ntpd/templates/ntp.conf.erb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ntpd/templates/ntp.conf.erb b/ntpd/templates/ntp.conf.erb index b4d2fec..e504fc1 100644 --- a/ntpd/templates/ntp.conf.erb +++ b/ntpd/templates/ntp.conf.erb @@ -16,7 +16,9 @@ restrict -6 default nomodify notrap nopeer noquery # Local users may interrogate the ntp server more closely. restrict 127.0.0.1 nomodify +<% if @ipv6enabled == "true" -%> restrict ::1 nomodify +<% end -%> # Drift file. driftfile /var/lib/ntp/ntp.drift