From e1060c5ecf89db03769937752ee29ac16d3fe868 Mon Sep 17 00:00:00 2001 From: gvelu Date: Fri, 22 Aug 2014 17:20:18 -0400 Subject: [PATCH 1/3] pam_ldap.conf.erb added in template and added the required entries for pam_ldap.conf.erb in auth.rb. Also in nslcd.conf.erb set ssl no --- recipes/auth.rb | 8 ++++++++ templates/default/nslcd.conf.erb | 2 +- templates/default/pam_ldap.conf.erb | 8 ++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 templates/default/pam_ldap.conf.erb diff --git a/recipes/auth.rb b/recipes/auth.rb index abcc5c8..ad77b81 100644 --- a/recipes/auth.rb +++ b/recipes/auth.rb @@ -70,3 +70,11 @@ owner "root" group "root" end + +template "/etc/pam_ldap.conf" do +source "pam_ldap.conf.erb" +owner "root" +group "root" +mode 0644 +end + diff --git a/templates/default/nslcd.conf.erb b/templates/default/nslcd.conf.erb index e2c5af5..8dbc0b8 100644 --- a/templates/default/nslcd.conf.erb +++ b/templates/default/nslcd.conf.erb @@ -7,7 +7,7 @@ uri ldap://<%= node['openldap']['server'] %> base <%= node['openldap']['basedn'] %> scope sub -ssl start_tls +ssl no tls_reqcert demand <% if node['openldap']['cafile'] -%> tls_cacertfile <%= node['openldap']['cafile'] %> diff --git a/templates/default/pam_ldap.conf.erb b/templates/default/pam_ldap.conf.erb new file mode 100644 index 0000000..e3bd14b --- /dev/null +++ b/templates/default/pam_ldap.conf.erb @@ -0,0 +1,8 @@ +uri ldap://<%= node['openldap']['server'] %> +base <%= node['openldap']['basedn'] %> +ssl no +<% if node['openldap']['cafile'] -%> +tls_cacertdir <%= node['openldap']['cafile'] %> +<% end -%> +pam_password md5 + From 87d727ab3a81c4f5acaef73edc296fe50ed0b561 Mon Sep 17 00:00:00 2001 From: gvelu Date: Fri, 22 Aug 2014 19:34:25 -0400 Subject: [PATCH 2/3] space added front of pam_ldap.conf in auth recipe --- recipes/auth.rb | 8 ++++---- templates/default/pam_ldap.conf.erb | 3 --- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/recipes/auth.rb b/recipes/auth.rb index ad77b81..2e73568 100644 --- a/recipes/auth.rb +++ b/recipes/auth.rb @@ -72,9 +72,9 @@ end template "/etc/pam_ldap.conf" do -source "pam_ldap.conf.erb" -owner "root" -group "root" -mode 0644 + source "pam_ldap.conf.erb" + owner "root" + group "root" + mode 0644 end diff --git a/templates/default/pam_ldap.conf.erb b/templates/default/pam_ldap.conf.erb index e3bd14b..f78235f 100644 --- a/templates/default/pam_ldap.conf.erb +++ b/templates/default/pam_ldap.conf.erb @@ -1,8 +1,5 @@ uri ldap://<%= node['openldap']['server'] %> base <%= node['openldap']['basedn'] %> ssl no -<% if node['openldap']['cafile'] -%> -tls_cacertdir <%= node['openldap']['cafile'] %> -<% end -%> pam_password md5 From d4e243343e3ef9d053902716be2aef585d601377 Mon Sep 17 00:00:00 2001 From: Karthikkumar Namasivayam Date: Mon, 25 Aug 2014 18:14:01 +0530 Subject: [PATCH 3/3] fix restart of nslcd --- recipes/auth.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipes/auth.rb b/recipes/auth.rb index 2e73568..943edac 100644 --- a/recipes/auth.rb +++ b/recipes/auth.rb @@ -58,10 +58,11 @@ template '/etc/nslcd.conf' do source 'nslcd.conf.erb' mode 0644 + notifies :restart, "service[nslcd]" end service 'nslcd' do - action [:enable, :restart] + action [:enable, :start] end cookbook_file "/etc/nsswitch.conf" do