Changeset - f4ac7ec4ad7f
[Not reviewed]
0 4 0
Branko Majic (branko) - 6 years ago 2018-06-28 21:39:45
branko@majic.rs
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.
4 files changed with 31 insertions and 20 deletions:
0 comments (0 inline, 0 general)
testsite/ansible.cfg
Show inline comments
 
[defaults]
 

	
 
roles_path=../roles
 
force_handlers = True
 
retry_files_save_path = ./retry
 
inventory = ./hosts
 

	
 
[ssh_connection]
 
pipelining = True
 
\ No newline at end of file
testsite/group_vars/ldap.yml
Show inline comments
 
@@ -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
testsite/playbooks/ldap.yml
Show inline comments
 
@@ -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
testsite/playbooks/site.yml
Show inline comments
 
---
 

	
 
- 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
0 comments (0 inline, 0 general)