Include vars when using standalone bootstrap role

When we use the standalone bootstrap role, we also need
to collect the correct var file. This changes adds the
logic to a block that we can skip as part of normal
deployment.

Change-Id: I807368e9de09a2c1a6a942d6b9cf46ec9e64b853
This commit is contained in:
Brendan Shephard 2022-05-17 11:26:20 +10:00
parent 366fa92e9d
commit ed41004568
1 changed files with 20 additions and 3 deletions

View File

@ -14,9 +14,26 @@
# License for the specific language governing permissions and limitations
# under the License.
- name: Gather facts if they don't exist
setup:
gather_subset: min
- name: Gather facts and variables if they don't exist
block:
- name: Gather facts if they don't exist
setup:
gather_subset: min
# found within the "vars/" path. If no OS files are found the task will skip.
- name: Gather variables for each operating system
include_vars: "{{ item }}"
with_first_found:
- skip: true
files:
- "{{ ansible_facts['distribution'] | lower }}-{{ ansible_facts['distribution_version'] | lower }}.yml"
- "{{ ansible_facts['distribution'] | lower }}-{{ ansible_facts['distribution_major_version'] | lower }}.yml"
- "{{ ansible_facts['os_family'] | lower }}-{{ ansible_facts['distribution_major_version'] | lower }}.yml"
- "{{ ansible_facts['distribution'] | lower }}.yml"
- "{{ ansible_facts['os_family'] | lower }}-{{ ansible_facts['distribution_version'].split('.')[0] }}.yml"
- "{{ ansible_facts['os_family'] | lower }}.yml"
tags:
- always
when: not ansible_distribution|default(false)
- name: Check required packages to bootstrap TripleO is installed