Changeset - c64473fcd1a8
[Not reviewed]
0 2 0
Branko Majic (branko) - 6 years ago 2018-08-01 12:30:35
branko@majic.rs
MAR-132: LDAP-related fixes to xmpp_server role tests:

- Do not create LDAP accounts through the ldap_entries parameter of
ldap_server, use the ldap_entry and ldap_attr modules directly.
2 files changed with 64 insertions and 53 deletions:
0 comments (0 inline, 0 general)
roles/xmpp_server/molecule/default/host_vars/ldap-server.yml
Show inline comments
 
@@ -2,59 +2,6 @@
 

	
 
# ldap_server role.
 
ldap_admin_password: admin
 
ldap_entries:
 

	
 
  # Users
 
  - dn: uid=john,ou=people,dc=local
 
    attributes:
 
      objectClass:
 
        - inetOrgPerson
 
        - simpleSecurityObject
 
      userPassword: johnpassword
 
      uid: john
 
      cn: John Doe
 
      sn: Doe
 
      mail: john.doe@domain1
 
  - dn: uid=jane,ou=people,dc=local
 
    attributes:
 
      objectClass:
 
        - inetOrgPerson
 
        - simpleSecurityObject
 
      userPassword: janepassword
 
      uid: jane
 
      cn: Jane Doe
 
      sn: Doe
 
      mail: jane.doe@domain2
 
  - dn: uid=mick,ou=people,dc=local
 
    attributes:
 
      objectClass:
 
        - inetOrgPerson
 
        - simpleSecurityObject
 
      userPassword: mickpassword
 
      uid: mick
 
      cn: Mick Doe
 
      sn: Doe
 
      mail: mick.doe@domain3
 

	
 
  - dn: uid=noxmpp,ou=people,dc=local
 
    attributes:
 
      objectClass:
 
        - inetOrgPerson
 
        - simpleSecurityObject
 
      userPassword: noxmpppassword
 
      uid: noxmpp
 
      cn: No XMPP
 
      sn: XMPP
 
      mail: noxmpp@domain1
 

	
 
  # Groups
 
  - dn: "cn=xmpp,ou=groups,dc=local"
 
    state: append
 
    attributes:
 
      uniqueMember:
 
        - uid=john,ou=people,dc=local
 
        - uid=jane,ou=people,dc=local
 
        - uid=mick,ou=people,dc=local
 

	
 
ldap_server_consumers:
 
  - name: prosody
roles/xmpp_server/molecule/default/prepare.yml
Show inline comments
 
@@ -113,6 +113,70 @@
 
    - ldap_server
 
    - backup_server
 

	
 
- hosts: ldap-server
 
  become: true
 
  tasks:
 

	
 
    - name: Create LDAP accounts for testing
 
      ldap_entry:
 
        dn: "{{ item.dn }}"
 
        objectClass: "{{ item.objectClass }}"
 
        attributes: "{{ item.attributes }}"
 
      with_items:
 
        - dn: uid=john,ou=people,dc=local
 
          objectClass:
 
            - inetOrgPerson
 
            - simpleSecurityObject
 
          attributes:
 
            userPassword: johnpassword
 
            uid: john
 
            cn: John Doe
 
            sn: Doe
 
            mail: john.doe@domain1
 

	
 
        - dn: uid=jane,ou=people,dc=local
 
          objectClass:
 
            - inetOrgPerson
 
            - simpleSecurityObject
 
          attributes:
 
            userPassword: janepassword
 
            uid: jane
 
            cn: Jane Doe
 
            sn: Doe
 
            mail: jane.doe@domain2
 

	
 
        - dn: uid=mick,ou=people,dc=local
 
          objectClass:
 
            - inetOrgPerson
 
            - simpleSecurityObject
 
          attributes:
 
            userPassword: mickpassword
 
            uid: mick
 
            cn: Mick Doe
 
            sn: Doe
 
            mail: mick.doe@domain3
 

	
 
        - dn: uid=noxmpp,ou=people,dc=local
 
          objectClass:
 
            - inetOrgPerson
 
            - simpleSecurityObject
 
          attributes:
 
            userPassword: noxmpppassword
 
            uid: noxmpp
 
            cn: No XMPP
 
            sn: XMPP
 
            mail: noxmpp@domain1
 

	
 
    - name: Add test accounts to correct group
 
      ldap_attr:
 
        dn: "cn=xmpp,ou=groups,dc=local"
 
        name: uniqueMember
 
        state: exact
 
        values:
 
          - uid=john,ou=people,dc=local
 
          - uid=jane,ou=people,dc=local
 
          - uid=mick,ou=people,dc=local
 

	
 
- hosts: parameters-optional
 
  become: true
 
  tasks:
0 comments (0 inline, 0 general)