[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
- config
- name: Ask admin if they are OK reinstalling this ipa server replica
ansible.builtin.pause:
prompt: "Do you want to reinstall replica for {{ item }}? (yes/no)"
register: confirm_replica
with_items: "{{ play_hosts }}"
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
# If you want to re-install replica again, just remove
# /var/log/ipainstall.log on the machine you want to re-install
# and this block will do the rest
# In case you want to re-install master node you need to follow
# IPA documentation as that is not straighforward
- name: Configure replication
when:
- not ipa_initial
- not check_replica.stat.exists
- confirm_replica | default('no') | bool
tags:
- ipa/server
- config