[IPA] Use ipactl status output for replication check

As the /etc/ipa/default.conf is already created by ipa/client role, we need to
find another way to check if replication is needed. Calling `ipactl status`
should be more reliable.

Signed-off-by: Michal Konecny <mkonecny@redhat.com>
This commit is contained in:
Michal Konecny 2023-11-16 12:06:22 +01:00
parent 4025b4d158
commit 3e349c80ec

View file

@ -110,8 +110,13 @@
- ipa/server - ipa/server
- config - config
# ipactl status has return code > 0 when the IPA is not set up yet
# even if the client is already installed
# Previously we checked in /etc/ipa/default.conf exists, but this
# is already created in ipa/client role so the replica never
# started
- name: determine whether we need to set up replication - name: determine whether we need to set up replication
stat: path=/etc/ipa/default.conf shell: ipactl status
register: replication_status register: replication_status
tags: tags:
- ipa/server - ipa/server
@ -186,7 +191,7 @@
--dirsrv-config-file=/root/ldif/replica-install.ldif --dirsrv-config-file=/root/ldif/replica-install.ldif
creates=/etc/ipa/default.conf creates=/etc/ipa/default.conf
when: ansible_distribution_major_version|int >= 8 when: ansible_distribution_major_version|int >= 8
when: not ipa_initial and not replication_status.stat.exists when: not ipa_initial and replication_status.rc > 0
tags: tags:
- ipa/server - ipa/server
- config - config