Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Example of using Ansible to fix an issue
Adding fix_ldap.yml as an example of a playbook that can be used to fix some type of issue on all of the training nodes. This playbook recreates everything needed just for the LDAP service running on the training nodes.
- Loading branch information
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,49 @@ | ||
- hosts: tag_role_comanage_registry | ||
become: yes | ||
gather_facts: True | ||
strategy: free | ||
|
||
tasks: | ||
- name: Stop comanage_ldap service | ||
community.general.docker_swarm_service: | ||
name: comanage_ldap | ||
state: absent | ||
tags: | ||
- training_nodes | ||
|
||
- name: Remove secret olc_root_pw | ||
docker_secret: | ||
name: olc_root_pw | ||
state: absent | ||
tags: | ||
- training_nodes | ||
|
||
- name: Remove secret olc_root_dn_password | ||
docker_secret: | ||
name: olc_root_dn_password | ||
state: absent | ||
tags: | ||
- training_nodes | ||
|
||
- name: Remove files and directories | ||
file: | ||
path: "{{ item }}" | ||
state: absent | ||
loop: | ||
- /srv/docker/etc/ldap/slapd.d/cn=config | ||
- /srv/docker/etc/ldap/slapd.d/cn=config.ldif | ||
- /srv/docker/var/lib/ldap/data.mdb | ||
- /srv/docker/var/lib/ldap/lock.mdb | ||
- /srv/docker/ldif/config-always-01.ldif | ||
tags: | ||
- training_nodes | ||
|
||
- import_role: | ||
name: training | ||
tags: | ||
- training_nodes | ||
|
||
- name: Redeploy comanage_ldap service | ||
command: docker stack deploy --compose-file /home/training/comanage-registry-stack.yml comanage | ||
tags: | ||
- training_nodes |