---
- name: Playbook to install IdM with our opinionated settings
  hosts: ipaserver
  become: true

  roles:
  - role: redhat.rhel_idm.ipaserver
    state: present


- name: Playbook to install IdM replicas with our opinionated settings
  hosts: ipareplicas
  become: true

  roles:
  - role: redhat.rhel_idm.ipareplica
    state: present

- name: Playbook to create full topology
  hosts: ipa
  become: true

  tasks:
    - name: Create full mesh topology segments
      redhat.rhel_idm.ipatopologysegment:
        ipaadmin_password: "{{ ipaadmin_password }}"
        left: "{{ inventory_hostname }}"
        right: "{{ item }}"
        state: present
        suffix: "domain+ca"
      loop: "{{ groups['ipa'] }}"
      when: item != inventory_hostname
