]> Frank Brehm's Git Trees - pixelpark/pp-admin-tools.git/commitdiff
Finishing playbooks/disable-ldap-server.yaml
authorFrank Brehm <frank.brehm@pixelpark.com>
Fri, 29 Nov 2024 11:44:52 +0000 (12:44 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Fri, 29 Nov 2024 11:44:52 +0000 (12:44 +0100)
playbooks/disable-ldap-server.yaml

index b589fb9f50ae75c35c692528c2c146985850e2e3..1804e52be2f531130cd9fe943eedd3445b191184 100644 (file)
       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: |
         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