An Ansible Playbook to deploy OpenLDAP and FusionDirectory
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

83 lignes
2.2KB

  1. ---
  2. - name: Update CA Certificates
  3. command: update-ca-certificates
  4. - name: Apply olcSSL.ldif
  5. command: ldapmodify -Y EXTERNAL -H ldapi:/// -f olcSSL.ldif
  6. args:
  7. chdir: /etc/ldap/custom_ldifs
  8. - name: Restart slapd
  9. service:
  10. name: slapd
  11. state: restarted
  12. - name: Apply FusionDirectory Schema
  13. command: fusiondirectory-insert-schema
  14. - name: Apply FusionDirectory Plugins Schema
  15. command: |
  16. fusiondirectory-insert-schema \
  17. -i /etc/ldap/schema/fusiondirectory/{{ item }}.schema
  18. with_items:
  19. - dsa-fd-conf
  20. - service-fd
  21. - systems-fd-conf
  22. - systems-fd
  23. - name: Initialize FusionDirectory Configuration
  24. command: |
  25. ldapadd -x -D {{ ldap_admin_dn }} -w {{ ldap_admin_pass }} -H ldapi:/// -f fd-init-config.ldif
  26. args:
  27. chdir: /etc/ldap/custom_ldifs
  28. no_log: True
  29. - name: Migrate Object Classes
  30. command: |
  31. ldapmodify -x -D {{ ldap_admin_dn }} -w {{ ldap_admin_pass }} -H ldapi:/// -f fd-migrate-object-classes.ldif
  32. args:
  33. chdir: /etc/ldap/custom_ldifs
  34. no_log: True
  35. - name: Generate FusionDirectory SuperUser and OUs
  36. shell: |
  37. yes '{{ fd_admin }}' | \
  38. fusiondirectory-setup --yes --check-ldap
  39. - name: Set SuperUser Password
  40. command: |
  41. ldappasswd -D {{ ldap_admin_dn }} -w {{ ldap_admin_pass }} -s {{ fd_admin_pass }} uid={{ fd_admin }},ou=people,{{ base_dn }}
  42. no_log: True
  43. - name: Migrate Default ACLs
  44. command: |
  45. ldapadd -x -D {{ ldap_admin_dn }} -w {{ ldap_admin_pass }} -H ldapi:/// -f fd-migrate-default-acl.ldif
  46. args:
  47. chdir: /etc/ldap/custom_ldifs
  48. no_log: True
  49. - name: Fix FusionDirectory Configuration Permisions
  50. command: fusiondirectory-setup --yes --check-config
  51. - name: Apply Service Accounts ACL
  52. command: |
  53. ldapadd -c -Y EXTERNAL -H ldapi:/// -f fd-service_accounts_acl.ldif
  54. args:
  55. chdir: /etc/ldap/custom_ldifs
  56. - name: Enable the Apache HTTP VirtualHost
  57. file:
  58. src: "/etc/apache2/sites-available/{{ domain }}.conf"
  59. dest: "/etc/apache2/sites-enabled/{{ domain }}.conf"
  60. state: link
  61. - name: Disable the Default Apache VirtualHost
  62. file:
  63. path: /etc/apache2/sites-enabled/000-default.conf
  64. state: absent
  65. - name: Restart Apache
  66. service:
  67. name: apache2
  68. state: restarted