Files @ 796d87f58565
Branch filter:

Location: majic-ansible-roles/testsite/playbooks/ldap.yml

branko
MAR-218: Fix the custom m_ldap_permissions module to work correctly with ansible-lint:

- In order for things to behave correctly, module should not invoke
the main part of code automatically during import, but only if run
via CLI.
- Without this the ansible-lint kept erroring out with:

"missing required arguments: filter, rules"
---

- hosts: ldap
  remote_user: ansible
  become: true
  roles:
    - common
    - 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