From: Frank Brehm Date: Fri, 29 Nov 2024 11:44:52 +0000 (+0100) Subject: Finishing playbooks/disable-ldap-server.yaml X-Git-Url: https://git.uhu-banane.net/?a=commitdiff_plain;h=b9fd1dee190ef2188314d6a8ec80a1e82152da06;p=pixelpark%2Fpp-admin-tools.git Finishing playbooks/disable-ldap-server.yaml --- diff --git a/playbooks/disable-ldap-server.yaml b/playbooks/disable-ldap-server.yaml index b589fb9..1804e52 100644 --- a/playbooks/disable-ldap-server.yaml +++ b/playbooks/disable-ldap-server.yaml @@ -51,26 +51,40 @@ register: tstamp check_mode: false changed_when: false - # when: ldapserver_to_disable == ansible_fqdn - name: "Show current timestamp" debug: var: tstamp verbosity: 3 - # when: ldapserver_to_disable == ansible_fqdn - name: "Set date variables" set_fact: cur_date: "{{ tstamp.stdout[0:10] | default('2024-11-11') }}" cur_time: "{{ tstamp.stdout[11:] | default('16-33-23') }}" cur_timestamp: "{{ tstamp.stdout[0:10] }}_{{ tstamp.stdout[11:] | default('2024-11-11_16-33-23') }}" - # when: ldapserver_to_disable == ansible_fqdn - name: "Show current date" debug: msg: "Current timestamp: '{{ cur_timestamp }}'." verbosity: 0 - # when: ldapserver_to_disable == ansible_fqdn + + - name: "Initial set target_replica_id" + ansible.builtin.set_fact: + target_replica_id: ~ + + - name: "Searching for target_replica_id ..." + ansible.builtin.set_fact: + target_replica_id: "{{ hostvars[other_host].replica_id }}" + when: "other_host == ldapserver_to_disable" + ignore_errors: true + loop: "{{ groups['ldap_servers'] }}" + loop_control: + loop_var: other_host + + - name: "Show target_replica_id" + debug: + var: target_replica_id + verbosity: 0 - name: "Disabling Puppet agent on '{{ ldapserver_to_disable }}'." ansible.builtin.shell: | @@ -150,4 +164,12 @@ suffix: "{{ item.key }}" loop: "{{ suffixes | dict2items | list }}" + - name: "Clean all RUVs for Replication ID {{ target_replica_id }} on all suffixes ..." + include_tasks: '../includes/389ds-repl-tasks-cleanallruv.yaml' + when: ldapserver_to_disable != ansible_fqdn + vars: + suffix: "{{ item.key }}" + loop: "{{ suffixes | dict2items | list }}" + + # vim: filetype=yaml