---
# tasks to uninstall IPA replica

- name: Set parameters
  ansible.builtin.set_fact:
    _ignore_topology_disconnect: "{{ ipaserver_ignore_topology_disconnect | default(ipareplica_ignore_topology_disconnect) | default(omit) }}"
    _ignore_last_of_role: "{{ ipaserver_ignore_last_of_role | default(ipareplica_ignore_last_of_role) | default(omit) }}"
    _remove_from_domain: "{{ ipaserver_remove_from_domain | default(ipareplica_remove_from_domain) | default(omit) }}"
    _remove_on_server: "{{ ipaserver_remove_on_server | default(ipareplica_remove_on_server) | default(omit) }}"

- name: Uninstall - Uninstall replica
  ansible.builtin.include_role:
    name: ipaserver
  vars:
    state: absent
    ipaserver_ignore_topology_disconnect: "{{ _ignore_topology_disconnect | default(false) }}"
    ipaserver_ignore_last_of_role: "{{ _ignore_last_of_role | default(false) }}"
    ipaserver_remove_from_domain: "{{ _remove_from_domain | default(false) }}"
    ipaserver_remove_on_server: "{{ _remove_on_server | default(NULL) }}"
