From d7133aeaee2a2b7f1b8a116458e6586ab4232d33 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Mon, 2 Dec 2024 12:11:28 +0100 Subject: [PATCH] Adding and using role 389ds-disable-replication --- playbooks/disable-ldap-server.yaml | 3 ++- .../389ds-disable-replication/tasks/main.yaml | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) rename includes/disable-389ds-replication.yaml => roles/389ds-disable-replication/tasks/main.yaml (82%) diff --git a/playbooks/disable-ldap-server.yaml b/playbooks/disable-ldap-server.yaml index ea95f35..a7b2731 100644 --- a/playbooks/disable-ldap-server.yaml +++ b/playbooks/disable-ldap-server.yaml @@ -192,7 +192,8 @@ - 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 }}" diff --git a/includes/disable-389ds-replication.yaml b/roles/389ds-disable-replication/tasks/main.yaml similarity index 82% rename from includes/disable-389ds-replication.yaml rename to roles/389ds-disable-replication/tasks/main.yaml index 49fb7f5..f6bf7e6 100644 --- a/includes/disable-389ds-replication.yaml +++ b/roles/389ds-disable-replication/tasks/main.yaml @@ -32,6 +32,10 @@ - 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 -- 2.39.5