Guest User

Untitled

a guest
Dec 12th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. include_recipe "krb5"
  2. include_recipe "resolver"
  3. include_recipe "yum::epel"
  4.  
  5. node['sssd']['packages'].each do |pkg|
  6. package pkg
  7. end
  8.  
  9. cookbook_file "/etc/pki/tls/certs/ldap-root-ca.cer" do
  10. source "root-ca.cer"
  11. mode "0600"
  12. owner "root"
  13. group "root"
  14. end
  15.  
  16. execute "kinit" do
  17. if node['platform_version'].to_f < 6 then
  18. command "echo 'mysecretpassword' | /usr/kerberos/bin/kinit Administrator"
  19. else
  20. command "echo 'mysecretpassword' | kinit Administrator"
  21. end
  22. action :run
  23. end
  24.  
  25. service "sssd" do
  26. action [ :enable ]
  27. end
  28.  
  29. template "/etc/sssd/sssd.conf" do
  30. source "sssd.conf.erb"
  31. owner "root"
  32. group "root"
  33. mode "0600"
  34. notifies :restart, resources(:service => "sssd")
  35. end
  36.  
  37. execute "do-authconfig" do
  38. command node['sssd']['authconfig']
  39. user "root"
  40. action :run
  41. end
  42.  
  43. execute "update-nsswitch.conf" do
  44. command "sed -i.bak 's/^passwd:.*/passwd: files sss/;s/^shadow:.*/shadow: files sss/;s/^group:.*/group: files sss/' /etc/nsswitch.conf"
  45. not_if "grep sss /etc/nsswitch.conf"
  46. action :run
  47. end
  48.  
  49. template "/etc/hosts" do
  50. source "hosts.erb"
  51. owner "root"
  52. group "root"
  53. mode "0644"
  54. end
  55.  
  56. execute "msktutil" do
  57. command "msktutil -c -b OU=Linux --computer-name `hostname` --server roota.ldaptest.local"
  58. not_if "test -f /etc/krb5.keytab"
  59. action :run
  60. end
Add Comment
Please, Sign In to add comment