From f4ac7ec4ad7fb4a07b637f082c3a403a7753ec29 2018-06-28 21:39:45 From: Branko Majic Date: 2018-06-28 21:39:45 Subject: [PATCH] MAR-129: Updated testsite configuration and playbooks: - Specify path to inventory file in testsite Ansible configuration. - Set-up group memberships in LDAP groups via separate play (since state: append does not work with stock ldap_entry - which is now used instead of m_ldap_entry). - Replace deprecated use of include with import_playbook. --- diff --git a/testsite/ansible.cfg b/testsite/ansible.cfg index 11e3971d6a0078e16ec6cb943b9695a6f2013219..4e194160188dd9b8b71c15ddc2f42bb48bdfaf5b 100644 --- a/testsite/ansible.cfg +++ b/testsite/ansible.cfg @@ -1,8 +1,8 @@ [defaults] - roles_path=../roles force_handlers = True retry_files_save_path = ./retry +inventory = ./hosts [ssh_connection] pipelining = True \ No newline at end of file diff --git a/testsite/group_vars/ldap.yml b/testsite/group_vars/ldap.yml index 8fda96897c5aae8ef135cfe939ed7a8288b1c49b..9135194db0eeac96f4430ab9740c7a5bd218f837 100644 --- a/testsite/group_vars/ldap.yml +++ b/testsite/group_vars/ldap.yml @@ -86,18 +86,6 @@ ldap_entries: sn: Doe userPassword: janedoe mail: jane.doe@{{ testsite_domain }} - - dn: "cn=mail,ou=groups,{{ testsite_ldap_base }}" - state: append - attributes: - uniqueMember: - - uid=johndoe,ou=people,{{ testsite_ldap_base }} - - uid=janedoe,ou=people,{{ testsite_ldap_base }} - - dn: "cn=xmpp,ou=groups,{{ testsite_ldap_base }}" - state: append - attributes: - uniqueMember: - - uid=johndoe,ou=people,{{ testsite_ldap_base }} - - uid=janedoe,ou=people,{{ testsite_ldap_base }} - dn: dc={{ testsite_domain }},ou=domains,ou=mail,ou=services,{{ testsite_ldap_base }} attributes: objectClass: dNSDomain diff --git a/testsite/playbooks/ldap.yml b/testsite/playbooks/ldap.yml index b2e4fc51576d2f3cb8e1be5390ea9c0b97b21eb0..f923015cc8679d05c30b168b71925da4394e2835 100644 --- a/testsite/playbooks/ldap.yml +++ b/testsite/playbooks/ldap.yml @@ -8,3 +8,26 @@ - mail_forwarder - ldap_client - ldap_server + +- hosts: ldap + remote_user: ansible + become: true + tasks: + + - name: Add users to mail LDAP group + ldap_attr: + dn: "cn=mail,ou=groups,{{ testsite_ldap_base }}" + name: uniqueMember + values: + - "uid=johndoe,ou=people,{{ testsite_ldap_base }}" + - "uid=janedoe,ou=people,{{ testsite_ldap_base }}" + state: present + + - name: Add user to XMPP LDAP group + ldap_attr: + dn: "cn=xmpp,ou=groups,{{ testsite_ldap_base }}" + name: uniqueMember + values: + - "uid=johndoe,ou=people,{{ testsite_ldap_base }}" + - "uid=janedoe,ou=people,{{ testsite_ldap_base }}" + state: present diff --git a/testsite/playbooks/site.yml b/testsite/playbooks/site.yml index b0ad8b25dfc79aeac8fd6dcb953096b022928344..1a2327662f1709635858a2f302ec611afb236c74 100644 --- a/testsite/playbooks/site.yml +++ b/testsite/playbooks/site.yml @@ -1,9 +1,9 @@ --- -- include: preseed.yml -- include: ldap.yml -- include: xmpp.yml -- include: mail.yml -- include: web.yml -- include: backup.yml -- include: ws.yml +- import_playbook: preseed.yml +- import_playbook: ldap.yml +- import_playbook: xmpp.yml +- import_playbook: mail.yml +- import_playbook: web.yml +- import_playbook: backup.yml +- import_playbook: ws.yml