mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-02-23 04:49:40 +01:00
9 lines
599 B
YAML
9 lines
599 B
YAML
- name: "import missing groups from {{ldif_docker_path}} to OpenLDAP"
|
|
shell: >
|
|
docker exec -i openldap {{ 'ldapmodify' if applications.ldap.openldap.modify|bool else 'ldapadd' }} -x -D "{{ldap.dn.administrator}}" -w "{{applications.ldap.administrator_database_password}}" -c -f "{{ldif_docker_path}}{{ item }}"
|
|
loop: "{{ ldif_files }}"
|
|
register: ldapadd_result
|
|
changed_when: "'adding new entry' in ldapadd_result.stdout"
|
|
# Allow return code 0 (all entries added) or 68 (entry already exists)
|
|
failed_when: ldapadd_result.rc not in [0, 68]
|
|
listen: "Import missing groups to OpenLDAP" |