[ipa/server] Don't ask for user input

As the pause module is only executed on first machine in the group I
decided to rather remove it completely.

This means that the replica will only be reinstalled, if the machine
isn't master node and the /var/log/ipainstall.log doesn't exist.

If somebody wants to re-install the replica they just need to remove
/var/log/ipainstall.log and the playbook will do the rest.
This commit is contained in:
Michal Konecny 2025-03-31 15:44:16 +02:00
parent 40136bda42
commit 80adc4e729

View file

@ -120,30 +120,15 @@
- ipa/server - ipa/server
- config - config
- name: Ask admin if they are OK reinstalling this ipa server replica # If you want to re-install replica again, just remove
ansible.builtin.pause: # /var/log/ipainstall.log on the machine you want to re-install
prompt: "Do you want to reinstall replica for {{ item }}? (yes/no)" # and this block will do the rest
register: confirm_replica # In case you want to re-install master node you need to follow
with_items: "{{ play_hosts }}" # IPA documentation as that is not straighforward
when: not ipa_initial or not check_replica.stat.exists
tags:
- ipa/server
- config
- name: Save the confirmation results to other hosts
ansible.builtin.set_fact:
confirm_replica: "{{ item.user_input }}"
with_items: "{{ hostvars[play_hosts.0].confirm_replica.results }}"
when: item.item == inventory_hostname
tags:
- ipa/server
- config
- name: Configure replication - name: Configure replication
when: when:
- not ipa_initial - not ipa_initial
- not check_replica.stat.exists - not check_replica.stat.exists
- confirm_replica | default('no') | bool
tags: tags:
- ipa/server - ipa/server
- config - config