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