[Rocky ONLY] Fix haproxy cert inject for check mode

Fixes the "Assign bootstrap node" task so that it runs under check mode
so that the bootstrap_node variable is created. Otherwise, the
subsequent tasks that use that variable fail during check mode.

This is a Rocky ONLY backport since it's no longer relevant on master
due to the template being refactored in:
https://review.openstack.org/#/c/605430/

Change-Id: I213abb3fe4608f9a4b6b1ce4956feb6e2766088f
Closes-Bug: #1795488
(cherry picked from commit 72dcf19b88)
This commit is contained in:
James Slagle 2018-10-01 14:24:30 -04:00
parent 05f1e3c95a
commit 7efe1087df
1 changed files with 2 additions and 1 deletions

View File

@ -85,8 +85,9 @@ outputs:
path: "{{cert_path}}"
- name: Assign bootstrap node
command: hiera -c /etc/puppet/hiera.yaml bootstrap_nodeid
command: hiera -c /etc/puppet/{{ ansible_check_mode | ternary('/check-mode', '') }}/hiera.yaml bootstrap_nodeid
register: bootstrap_node
check_mode: no
- name: set is_bootstrap_node fact
set_fact: is_bootstrap_node={{bootstrap_node.stdout|lower == ansible_hostname|lower}}