Factor the replication tasks in a block
Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
This commit is contained in:
parent
2afc689d5e
commit
f6e6921655
1 changed files with 62 additions and 74 deletions
|
@ -94,43 +94,33 @@
|
|||
- config
|
||||
when: not ipa_initial
|
||||
|
||||
- name: configure replication
|
||||
block:
|
||||
- name: create replica file
|
||||
delegate_to: ipa01{{ env_suffix }}.iad2.fedoraproject.org
|
||||
command: ipa-replica-prepare
|
||||
--password={{ipa_dm_password}}
|
||||
{{inventory_hostname}}
|
||||
creates=/var/lib/ipa/replica-info-{{inventory_hostname}}.gpg
|
||||
tags:
|
||||
- ipa/server
|
||||
- config
|
||||
when: not ipa_initial and ansible_distribution_major_version|int < 8 and not replication_status.stat.exists
|
||||
when: ansible_distribution_major_version|int < 8
|
||||
|
||||
- name: retrieve replica file
|
||||
delegate_to: ipa01{{ env_suffix }}.iad2.fedoraproject.org
|
||||
fetch: src=/var/lib/ipa/replica-info-{{inventory_hostname}}.gpg
|
||||
dest=/tmp/ipa_replica_{{inventory_hostname}}.gpg
|
||||
flat=yes
|
||||
tags:
|
||||
- ipa/server
|
||||
- config
|
||||
when: not ipa_initial and ansible_distribution_major_version|int < 8 and not replication_status.stat.exists
|
||||
when: ansible_distribution_major_version|int < 8
|
||||
|
||||
- name: deploy replica file
|
||||
copy: src=/tmp/ipa_replica_{{inventory_hostname}}.gpg
|
||||
dest=/root/ipa_replica_{{inventory_hostname}}.gpg
|
||||
mode=0600 owner=root group=root
|
||||
tags:
|
||||
- ipa/server
|
||||
- config
|
||||
when: not ipa_initial and ansible_distribution_major_version|int < 8 and not replication_status.stat.exists
|
||||
when: ansible_distribution_major_version|int < 8
|
||||
|
||||
- name: destroy replica file on ansible host
|
||||
delegate_to: localhost
|
||||
file: path=/tmp/ipa_replica_{{inventory_hostname}}.gpg state=absent
|
||||
tags:
|
||||
- ipa/server
|
||||
- config
|
||||
when: not ipa_initial and ansible_distribution_major_version|int < 8 and not replication_status.stat.exists
|
||||
when: ansible_distribution_major_version|int < 8
|
||||
|
||||
- name: deploy replica
|
||||
command: ipa-replica-install
|
||||
|
@ -150,10 +140,7 @@
|
|||
--log-file=/var/log/ipainstall.log
|
||||
/root/ipa_replica_{{inventory_hostname}}.gpg
|
||||
creates=/etc/ipa/default.conf
|
||||
tags:
|
||||
- ipa/server
|
||||
- config
|
||||
when: not ipa_initial and ansible_distribution_major_version|int < 8 and not replication_status.stat.exists
|
||||
when: ansible_distribution_major_version|int < 8
|
||||
|
||||
- name: deploy replica
|
||||
command: ipa-replica-install
|
||||
|
@ -172,10 +159,11 @@
|
|||
--domain={{ipa_realm}}
|
||||
--server=ipa01{{ env_suffix }}.iad2.fedoraproject.org
|
||||
creates=/etc/ipa/default.conf
|
||||
when: ansible_distribution_major_version|int >= 8
|
||||
when: not ipa_initial and not replication_status.stat.exists
|
||||
tags:
|
||||
- ipa/server
|
||||
- config
|
||||
when: not ipa_initial and ansible_distribution_major_version|int >= 8 and not replication_status.stat.exists
|
||||
|
||||
- name: Disable rewrites
|
||||
copy: src=ipa-rewrite.conf dest=/etc/httpd/conf.d/ipa-rewrite.conf
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue