[ipa/server] Use the prompt output for all servers
Signed-off-by: Michal Konecny <mkonecny@redhat.com>
This commit is contained in:
parent
f5ae5a017f
commit
59824e4d8b
1 changed files with 7 additions and 22 deletions
|
@ -99,33 +99,15 @@
|
||||||
- name: Check if /var/log/ipainstall.log is available
|
- name: Check if /var/log/ipainstall.log is available
|
||||||
ansible.builtin.stat:
|
ansible.builtin.stat:
|
||||||
path: /var/log/ipainstall.log
|
path: /var/log/ipainstall.log
|
||||||
register: replica_log
|
register: check_replica
|
||||||
tags:
|
|
||||||
- ipa/server
|
|
||||||
- config
|
|
||||||
|
|
||||||
- name: Saving /var/log/ipainstall.log check
|
|
||||||
ansible.builtin.set_fact:
|
|
||||||
replica_check: replica_log.stat.exists
|
|
||||||
tags:
|
tags:
|
||||||
- ipa/server
|
- ipa/server
|
||||||
- config
|
- config
|
||||||
|
|
||||||
- name: ask admin if they are ok reinstalling this ipa server replica
|
- name: ask admin if they are ok reinstalling this ipa server replica
|
||||||
ansible.builtin.pause:
|
ansible.builtin.pause:
|
||||||
prompt: "Looks like replica for {{ item }} should be reinstalled, are you sure you want to do that? (yes/no)"
|
prompt: "Do you want to reinstall replicas for all replica servers missing /var/log/ipainstall.log (this indicates that the ipa-replica-install wasn't run yet)? (yes/no)"
|
||||||
when: "not ipa_initial and (not {{ hostvars[item]['replica_check'] }})"
|
register: confirm_replica
|
||||||
register: input
|
|
||||||
with_items: "{{ play_hosts }}"
|
|
||||||
tags:
|
|
||||||
- ipa/server
|
|
||||||
- config
|
|
||||||
|
|
||||||
- name: Save the user input
|
|
||||||
ansible.builtin.set_fact:
|
|
||||||
confirm_replica: "{{ item.user_input }}"
|
|
||||||
with_items: "{{ hostvars[play_hosts.0].input.results }}"
|
|
||||||
when: item.item == inventory_hostname
|
|
||||||
tags:
|
tags:
|
||||||
- ipa/server
|
- ipa/server
|
||||||
- config
|
- config
|
||||||
|
@ -159,7 +141,10 @@
|
||||||
--server={{ipa_server}}
|
--server={{ipa_server}}
|
||||||
--dirsrv-config-file=/root/ldif/replica-install.ldif
|
--dirsrv-config-file=/root/ldif/replica-install.ldif
|
||||||
when: ansible_distribution_major_version|int >= 8
|
when: ansible_distribution_major_version|int >= 8
|
||||||
when: not ipa_initial and (confirm_replica | default('no') | bool)
|
when:
|
||||||
|
- not ipa_initial
|
||||||
|
- not check_replica.stat.exists
|
||||||
|
- confirm_replica.user_input | default('no') | bool
|
||||||
tags:
|
tags:
|
||||||
- ipa/server
|
- ipa/server
|
||||||
- config
|
- config
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue