Playbooks to a new Lilik
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
2.1 KiB

  1. - name: configure libpam-ldap
  2. debconf:
  3. name: 'libpam-ldap'
  4. question: '{{ item.key }}'
  5. vtype: 'string'
  6. value: '{{ item.value }}'
  7. with_dict:
  8. libpam-ldap/bindpw: (password omitted)
  9. libpam-ldap/rootbindpw: (password omitted)
  10. libpam-ldap/rootbinddn:
  11. libpam-ldap/dbrootlogin: false
  12. libpam-ldap/dblogin: false
  13. libpam-ldap/override: 'true'
  14. libpam-ldap/pam_password: crypt
  15. libpam-ldap/binddn:
  16. shared/ldapns/ldap_version: 3
  17. shared/ldapns/ldap-server: ldap://{{ ldap_server }}/
  18. shared/ldapns/base-dn: dc=lilik,dc=it
  19. notify:
  20. - update libpam-ldap configuration
  21. - name: configure libnss-ldap
  22. debconf:
  23. name: 'libnss-ldap'
  24. question: '{{ item.key }}'
  25. vtype: 'string'
  26. value: '{{ item.value }}'
  27. with_dict:
  28. libnss-ldap/bindpw: (password omitted)
  29. libnss-ldap/rootbindpw: (password omitted)
  30. libnss-ldap/override: 'true'
  31. libnss-ldap/confperm: true
  32. libnss-ldap/dbrootlogin: false
  33. libnss-ldap/nsswitch:
  34. libnss-ldap/binddn:
  35. libnss-ldap/rootbinddn:
  36. libnss-ldap/dblogin: false
  37. shared/ldapns/ldap_version: 3
  38. shared/ldapns/ldap-server: ldap://{{ ldap_server }}/
  39. shared/ldapns/base-dn: dc=lilik,dc=it
  40. notify:
  41. - update libnss-ldap configuration
  42. - name: set default shell to bash in skel
  43. lineinfile:
  44. insertbefore: BOF
  45. dest: /etc/skel/.profile
  46. line: 'SHELL=/bin/bash exec /bin/bash'
  47. regexp: '^SHELL='
  48. - name: create user home on login
  49. template:
  50. src: pam-mkhomedir.j2
  51. dest: /usr/share/pam-configs/mkhomedir
  52. notify: pam-auth-update
  53. - name: enable nss ldap passwd
  54. lineinfile:
  55. dest: /etc/nsswitch.conf
  56. line: 'passwd: compat ldap'
  57. regexp: '^passwd:'
  58. notify: restart nscd
  59. - name: enable nss ldap group
  60. lineinfile:
  61. dest: /etc/nsswitch.conf
  62. line: 'group: compat ldap'
  63. regexp: '^group:'
  64. notify: restart nscd
  65. - name: install pam ldap packages
  66. apt:
  67. name: "{{ item }}"
  68. state: present
  69. update_cache: yes
  70. cache_valid_time: 3600
  71. with_items:
  72. - libpam-ldap
  73. - libnss-ldap
  74. # TODO: log, add a centralized log server
  75. - rsyslog