]> Frank Brehm's Git Trees - pixelpark/pp-admin-tools.git/commitdiff
Finishing Ansible role 389ds-init-replication
authorFrank Brehm <frank.brehm@pixelpark.com>
Wed, 18 Dec 2024 13:59:47 +0000 (14:59 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Wed, 18 Dec 2024 13:59:47 +0000 (14:59 +0100)
roles/389ds-init-replication/tasks/main.yaml
roles/389ds-init-replication/tasks/suffix.yaml

index fafca097780815eba8a57f3d15cc2ed50f1637f4..b84b833d460b63309dd19cb92080c982e59349d3 100644 (file)
   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
 
index baaa036ff7161717e384af3b08bb3163f71baa12..444ad779c13a047d6507048582aaddd43509b4b4 100644 (file)
@@ -1,18 +1,54 @@
 ---
 
-- 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