cookbooks/mu-master/recipes/389ds.rb in cloud-mu-2.0.0.pre.alpha7 vs cookbooks/mu-master/recipes/389ds.rb in cloud-mu-2.0.0.pre.alpha8

- old
+ new

@@ -48,11 +48,11 @@ directory "/root/389ds.tmp" do recursive true mode 0700 end -$CREDS.each_pair { |creds, cfg| +$CREDS.each_pair { |creds, _cfg| user = pw = data = nil if $MU_CFG["ldap"].has_key?(creds) data = chef_vault_item($MU_CFG['ldap'][creds]['vault'], $MU_CFG['ldap'][creds]['item']) user = data[$MU_CFG["ldap"][creds]["username_field"]] pw = data[$MU_CFG["ldap"][creds]["password_field"]] @@ -71,22 +71,22 @@ recursive true end # %x{/usr/sbin/setenforce 0} execute "initialize 389 Directory Services" do - command "/usr/sbin/setup-ds-admin.pl -s -f /root/389ds.tmp/389-directory-setup.inf --continue --debug #{Dir.exists?("/etc/dirsrv/slapd-#{$MU_CFG["hostname"]}") ? "--update" : ""}" + command "/usr/sbin/setup-ds-admin.pl -s -f /root/389ds.tmp/389-directory-setup.inf --continue --debug #{Dir.exist?("/etc/dirsrv/slapd-#{$MU_CFG["hostname"]}") ? "--update" : ""}" action :nothing end template "/root/389ds.tmp/389-directory-setup.inf"do source "389-directory-setup.inf.erb" variables :hostname => $MU_CFG["hostname"], :address => $MU_CFG["public_address"].match(/^\d+\.\d+\.\d+\.\d+$/) ? "localhost" : $MU_CFG["public_address"], :domain => $MU_CFG["ldap"]["domain_name"], :domain_dn => $MU_CFG["ldap"]["domain_name"].split(/\./).map{ |x| "DC=#{x}" }.join(","), :creds => $CREDS - not_if { ::Dir.exists?("/etc/dirsrv/slapd-#{$MU_CFG["hostname"]}") } + not_if { ::Dir.exist?("/etc/dirsrv/slapd-#{$MU_CFG["hostname"]}") } notifies :run, "execute[initialize 389 Directory Services]", :immediately end service service_name do action [:enable, :start] @@ -129,10 +129,10 @@ ruby_block "import SSL certificates for 389ds" do block do certimportcmd = "/usr/bin/pk12util -i /opt/mu/var/ssl/ldap.p12 -d /etc/dirsrv/slapd-#{$MU_CFG["hostname"]} -w /root/389ds.tmp/blank -W \"\"" require 'pty' require 'expect' - PTY.spawn(certimportcmd) { |r, w, pid| + PTY.spawn(certimportcmd) { |r, w, _pid| begin r.expect("Enter new password:") do w.puts end r.expect("Re-enter password:") do