check_mode: false
- name: "Show current get_backend_suffix_list"
- debug:
+ ansible.builtin.debug:
var: get_backend_suffix_list
verbosity: 2
- name: "Set backend variable"
- no_log: true
- set_fact:
+ ansible.builtin.set_fact:
suffix_names: "{{ get_backend_suffix_list.stdout_lines | map('regex_replace', '\\s+\\(.+\\)\\s*$', '') | list }}"
backend_names: "{{ get_backend_suffix_list.stdout_lines | map('regex_replace', '^.*\\((.+)\\)\\s*$', '\\1') | list }}"
- name: "Set suffixes dict"
- no_log: true
- set_fact:
+ ansible.builtin.set_fact:
suffixes: "{{ dict( suffix_names | zip(backend_names) ) }}"
- name: "Show current suffixes"
- debug:
+ ansible.builtin.debug:
var: suffixes
verbosity: 0
---
-- debug:
+- ansible.builtin.debug:
msg: "start init of replication agreement from {{ inventory_hostname | quote }} \
to {{ target_host | quote }} for suffix {{ suffix | quote }}."
verbosity: 0
- name: "Set fact agreement_name."
- set_fact:
+ ansible.builtin.set_fact:
agreement_name: "{{ slapd_instance }} to {{ target_host }} agreement"
-- name: "Show replication agreement name for suffix {{ suffix | quote }}."
- debug:
+- name: "Show replication agreement name for suffix."
+ ansible.builtin.debug:
var: agreement_name
+ verbosity: 2
+
+- name: "Defining the command for start init replication agreement."
+ ansible.builtin.set_fact:
+ cmd_init_repl_agmt: "dsconf {{ slapd_instance | quote }} repl-agmt init --suffix {{ suffix | quote }} {{ agreement_name | quote }}"
+
+- name: "Show command for start init replication agreement:"
+ ansible.builtin.debug:
+ var: cmd_init_repl_agmt
+ verbosity: 1
+
+- name: "Start init replication agreement:"
+ ansible.builtin.shell: "{{ cmd_init_repl_agmt }}"
+
+- name: "Defining the command for checking status of init replication agreement."
+ ansible.builtin.set_fact:
+ cmd_check_init_repl_agmt: "dsconf {{ slapd_instance | quote }} repl-agmt init-status --suffix {{ suffix | quote }} {{ agreement_name | quote }}"
+
+- name: "Show command for checking status of init replication agreement:"
+ ansible.builtin.debug:
+ var: cmd_check_init_repl_agmt
verbosity: 0
+- name: "Checking the status of init replication agreement."
+ ansible.builtin.shell: "{{ cmd_check_init_repl_agmt }}"
+ register: get_status_init_repl_agmt
+ changed_when: false
+ check_mode: false
+
+- name: "Show current get_status_init_repl_agmt"
+ ansible.builtin.debug:
+ var: get_status_init_repl_agmt
+ verbosity: 2
+
+- name: "Current status of init replication agreement:"
+ ansible.builtin.debug:
+ var: get_status_init_repl_agmt.stdout
+
# vim: filetype=yaml