+++ /dev/null
----
-
-- name: "Get a list of all replicated Suffixes."
- ansible.builtin.shell: "dsconf '{{ slapd_instance }}' replication list"
- check_mode: false
- changed_when: false
- register: list_of_replicated_suffixes
-
-- name: "Show current list_of_replicated_suffixes"
- debug:
- var: list_of_replicated_suffixes
- verbosity: 2
-
-- name: "Set fact suffix_is_replicated."
- no_log: true
- set_fact:
- suffix_is_replicated: false
-
-- name: "Searching for suffix '{{ suffix }}' in the list of replicated suffixes."
- set_fact:
- suffix_is_replicated: true
- when: ( this_line | regex_replace('^\\s*') | regex_replace('\\s*$') ) == suffix
- loop: "{{ list_of_replicated_suffixes.stdout_lines }}"
- loop_control:
- loop_var: this_line
-
-- name: "Set fact list_of_replicated_suffixes."
- no_log: true
- set_fact:
- list_of_replicated_suffixes: ~
-
-- name: "The suffix '{{ suffix }}' is replicated:"
- debug:
- var: suffix_is_replicated
-
-
-# vim: filetype=yaml
- name: "Disabling replication on all suffixes."
when: ldapserver_to_disable == inventory_hostname
- include_tasks: '../includes/disable-389ds-replication.yaml'
+ include_role:
+ name: 389ds-disable-replication
vars:
suffix: "{{ item.key }}"
loop: "{{ suffixes | dict2items | list }}"
--- /dev/null
+---
+
+- name: "Get a list of all replicated Suffixes."
+ ansible.builtin.shell: "dsconf '{{ slapd_instance }}' replication list"
+ check_mode: false
+ changed_when: false
+ register: list_of_replicated_suffixes
+
+- name: "Show current list_of_replicated_suffixes"
+ debug:
+ var: list_of_replicated_suffixes
+ verbosity: 2
+
+- name: "Set fact suffix_is_replicated."
+ no_log: true
+ set_fact:
+ suffix_is_replicated: false
+
+- name: "Searching for suffix '{{ suffix }}' in the list of replicated suffixes."
+ set_fact:
+ suffix_is_replicated: true
+ when: ( this_line | regex_replace('^\\s*') | regex_replace('\\s*$') ) == suffix
+ loop: "{{ list_of_replicated_suffixes.stdout_lines }}"
+ loop_control:
+ loop_var: this_line
+
+- name: "Set fact list_of_replicated_suffixes."
+ no_log: true
+ set_fact:
+ list_of_replicated_suffixes: ~
+
+- name: "The suffix '{{ suffix }}' is replicated:"
+ debug:
+ var: suffix_is_replicated
+ verbosity: 0
+
+- name: "Finally remove replication from suffix '{{ suffix }}'."
+ ansible.builtin.shell: "dsconf '{{ slapd_instance }}' disable --suffix '{{ suffix }}'"
+ when: suffix_is_replicated == true
+
+# vim: filetype=yaml