+++ /dev/null
----
-
-- name: "Set fact agreement_name."
- set_fact:
- agreement_name: "{{ slapd_instance }} to {{ target }} agreement"
-
-- name: "Show replication agreement name for suffix '{{ suffix }}'."
- debug:
- var: agreement_name
- verbosity: 0
-
-- name: "Removing replication agreement '{{ agreement_name }}' for suffix '{{ suffix }}'."
- ansible.builtin.shell: "dsconf '{{ slapd_instance }}' repl-agmt delete --suffix '{{ suffix }}' '{{ agreement_name }}'"
- ignore_errors: true
-
-
-# vim: filetype=yaml
+++ /dev/null
----
-
-- name: "Removing replication agreement to '{{ target }}' on suffix '{{ suffix }}'."
- include_tasks: '../includes/del-389ds-backend-repl-agmt.yaml'
- when: target == ldapserver_to_disable
-
-# vim: filetype=yaml
+++ /dev/null
----
-
-# name: "Removing replication agreements to '{{ target }}' on suffix '{{ suffix }}'."
-# when: target != ansible_fqdn
-# block:
-
-# - name: "Set fact agreement_name."
-# set_fact:
-# agreement_name: "{{ slapd_instance }} to {{ target }} agreement"
-
-# - name: "Show replication agreement name for suffix '{{ suffix }}'."
-# debug:
-# var: agreement_name
-# verbosity: 0
-
-# - name: "Removing replication agreement '{{ agreement_name }}' for suffix '{{ suffix }}'."
-# ansible.builtin.shell: "dsconf '{{ slapd_instance }}' repl-agmt delete --suffix '{{ suffix }}' '{{ agreement_name }}'"
-# ignore_errors: true
-
-- name: "Removing replication agreements to '{{ target }}' on suffix '{{ suffix }}'."
- when: target != ansible_fqdn
- include_tasks: '../includes/del-389ds-backend-repl-agmt.yaml'
-
-# vim: filetype=yaml
backend: "{{ haproxy_backend_name }}"
backend_server: "{{ ldapserver_to_disable }}"
- # - name: "Fail for stop."
- # ansible.builtin.fail:
- # msg: "Hard stopping here ..."
-
- name: "Disabling Replication on the given host."
hosts: ldap_servers
+ gather_facts: false
tasks:
loop_var: backend
- name: "Removing replication agreements on host to disable."
- include_tasks: '../includes/del-389ds-backend-repl-agmts-target.yaml'
+ include_role:
+ name: 389ds-del-repl-agmt
when: ldapserver_to_disable == inventory_hostname
vars:
+ direction: 'from-disabled'
suffix: "{{ item[0].key }}"
target: "{{ item[1] }}"
loop: "{{ suffixes | dict2items | product( ansible_play_batch ) | list }}"
- name: "Removing replication agreements on hosts to keep."
- include_tasks: '../includes/del-389ds-backend-repl-agmts-src.yaml'
+ include_role:
+ name: 389ds-del-repl-agmt
when: ldapserver_to_disable != inventory_hostname
vars:
+ direction: 'to-disabled'
suffix: "{{ item[0].key }}"
target: "{{ item[1] }}"
loop: "{{ suffixes | dict2items | product( ansible_play_batch ) | list }}"
--- /dev/null
+---
+
+- name: "Set fact agreement_name."
+ set_fact:
+ agreement_name: "{{ slapd_instance }} to {{ target }} agreement"
+
+- name: "Show replication agreement name for suffix '{{ suffix }}'."
+ debug:
+ var: agreement_name
+ verbosity: 0
+
+- name: "Removing replication agreement '{{ agreement_name }}' for suffix '{{ suffix }}'."
+ ansible.builtin.shell: "dsconf '{{ slapd_instance }}' repl-agmt delete --suffix '{{ suffix }}' '{{ agreement_name }}'"
+ ignore_errors: true
+
+
+# vim: filetype=yaml
--- /dev/null
+---
+
+- name: "Removing replication agreements."
+ debug:
+ var: direction
+ verbosity: 0
+
+- name: "Removing replication agreements to '{{ target }}' on suffix '{{ suffix }}'."
+ when: direction == 'from-disabled' and target != inventory_hostname
+ include_tasks: 'del-repl-agmt.yaml'
+
+- name: "Removing replication agreement to '{{ target }}' on suffix '{{ suffix }}'."
+ when: direction == 'to-disabled' and target == ldapserver_to_disable
+ include_tasks: 'del-repl-agmt.yaml'
+
+
+# vim: filetype=yaml