From a1b6379b9a0699394e47818857e515c25749a0fe Mon Sep 17 00:00:00 2001 From: Ossi Herrala Date: Thu, 7 Feb 2013 10:50:37 +0000 Subject: [PATCH 1/4] Use database name for Base DN in replication. Works better in multi DB LDAP configuration. --- ldap/templates/slapd-database.conf.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ldap/templates/slapd-database.conf.erb b/ldap/templates/slapd-database.conf.erb index 8711540..32d4125 100644 --- a/ldap/templates/slapd-database.conf.erb +++ b/ldap/templates/slapd-database.conf.erb @@ -40,7 +40,7 @@ syncrepl rid=2 provider=<%= master %> type=refreshAndPersist retry="10 10 60 +" - searchbase="<%= ldap_basedn %>" + searchbase="<%= name %>" filter="(objectClass=*)" scope="sub" sizelimit=500000 @@ -48,7 +48,7 @@ syncrepl rid=2 schemachecking="off" bindmethod="simple" tls_reqcert="never" - binddn="uid=replicator,cn=config,<%= ldap_basedn %>" + binddn="uid=replicator,cn=config,<%= name %>" credentials="<%= syncpw %>" updateref <%= master %> <% end -%> From 933a2fce34539633a3f285e36a5f648cd150e6d3 Mon Sep 17 00:00:00 2001 From: Ossi Salmi Date: Thu, 7 Feb 2013 14:05:39 +0200 Subject: [PATCH 2/4] Updated Moin version to 1.9.6 in wiki/Makefile --- wiki/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wiki/Makefile b/wiki/Makefile index 84864ae..8302049 100644 --- a/wiki/Makefile +++ b/wiki/Makefile @@ -4,7 +4,7 @@ GWIKIBRANCH = default GWIKISOURCE = https://bitbucket.org/clarifiednetworks/graphingwiki/get/$(GWIKIBRANCH).tar.gz GWIKITARGET = graphingwiki-$(GWIKIBRANCH)-$(TIMESTAMP).tar.gz -MOINVERSION = 1.9.4 +MOINVERSION = 1.9.6 MOINSOURCE = http://static.moinmo.in/files/moin-$(MOINVERSION).tar.gz MOINTARGET = moin-$(MOINVERSION).tar.gz From d23e9995d6ae910a11e029d531713e7a661eded5 Mon Sep 17 00:00:00 2001 From: Ossi Herrala Date: Thu, 7 Feb 2013 12:26:24 +0000 Subject: [PATCH 3/4] Introduce configurable rid ("Replica ID"?) per database. This is needed for multi DB replication. --- ldap/manifests/init.pp | 11 ++++++++++- ldap/templates/slapd-database.conf.erb | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ldap/manifests/init.pp b/ldap/manifests/init.pp index 220ed3f..ac90b62 100644 --- a/ldap/manifests/init.pp +++ b/ldap/manifests/init.pp @@ -611,6 +611,9 @@ class ldap::server { # Password for uid=replicator,cn=config,${name} user on master. # Only needed for slave databases. # +# $rid: +# Replica ID. Must be unique per replica per database. +# # $moduleoptions: # Options for overlay modules. # @@ -620,10 +623,16 @@ class ldap::server { # moduleoptions => [ "smbkrb5pwd-enable=samba", ] # } # -define ldap::server::database($aclsource = "", $master = "", $syncpw = "", $moduleoptions = []) { +define ldap::server::database($aclsource = "", $master = "", $syncpw = "", $rid = "", $moduleoptions = []) { include ldap::server + if $rid == "" { + $rid_real = fqdn_rand(999) + } else { + $rid_real = $rid + } + file { "${ldap::server::config}/slapd.conf.d/db.${name}.conf": ensure => present, content => template("ldap/slapd-database.conf.erb"), diff --git a/ldap/templates/slapd-database.conf.erb b/ldap/templates/slapd-database.conf.erb index 32d4125..bea1fb8 100644 --- a/ldap/templates/slapd-database.conf.erb +++ b/ldap/templates/slapd-database.conf.erb @@ -29,14 +29,14 @@ overlay syncprov syncprov-checkpoint 100 10 syncprov-sessionlog 100 -# The database directory MUST exist prior to running slapd AND +# The database directory MUST exist prior to running slapd AND # should only be accessible by the slapd and slap tools. # Mode 700 recommended. directory /srv/ldap/<%= name %> <% if master != "" -%> # replication -syncrepl rid=2 +syncrepl rid=<%= rid_real %> provider=<%= master %> type=refreshAndPersist retry="10 10 60 +" From e31b70b74948522867b72de89bbe526a985e039b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20M=E4kinen?= Date: Fri, 8 Feb 2013 08:53:52 +0200 Subject: [PATCH 4/4] Fixed SELinux contexts from git data directories. --- git/manifests/init.pp | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/git/manifests/init.pp b/git/manifests/init.pp index fc16834..42009c1 100644 --- a/git/manifests/init.pp +++ b/git/manifests/init.pp @@ -33,10 +33,11 @@ class git::server { if $git_datadir { file { $git_datadir: - ensure => directory, - mode => "0755", - owner => "root", - group => "root", + ensure => directory, + mode => "0755", + owner => "root", + seltype => "git_system_content_t", + group => "root", } file { "/srv/git": ensure => link, @@ -49,20 +50,13 @@ class git::server { mode => "0755", owner => "root", group => "root", - seltype => "httpd_sys_content_t", } } - if "${selinux}" == "true" { - selinux::manage_fcontext { "/srv/git(/.*)?": - type => "httpd_sys_content_t", - before => File["/srv/git"], - } - if $git_datadir { - selinux::manage_fcontext { "${git_datadir}(/.*)?": - type => "httpd_sys_content_t", - before => File[$git_datadir], - } + if $git_datadir { + selinux::manage_fcontext { "${git_datadir}(/.*)?": + type => "git_system_content_t", + before => File[$git_datadir], } }