Define install_method default when hosts resolution depend on it

In some playbooks we try to fetch openstack_service_setup_host based on
install_method variable. However, if variable is not defined,
and it is not by default, playbooks will run against localhost,
which will result in failure.

Closes-Bug: #2031647
Change-Id: I247ce2a808076ff55347db54327a1e4913ea3006
This commit is contained in:
Dmitriy Rabotyagov 2023-08-17 14:29:25 +02:00 committed by Dmitriy Rabotyagov
parent 997b0d78d9
commit f05c90103c
3 changed files with 3 additions and 3 deletions

View File

@ -17,7 +17,7 @@
hosts: "{{ openstack_service_setup_host | default('localhost') }}"
user: root
vars_files:
- "defaults/{{ install_method }}_install.yml"
- "defaults/{{ install_method | default('source') }}_install.yml"
vars:
ansible_python_interpreter: >-
{{ openstack_service_setup_host_python_interpreter |

View File

@ -102,7 +102,7 @@
hosts: "{{ openstack_service_setup_host | default('localhost') }}"
gather_facts: no
vars_files:
- "defaults/{{ install_method }}_install.yml"
- "defaults/{{ install_method | default('source') }}_install.yml"
vars:
ansible_python_interpreter: "{{ openstack_service_setup_host_python_interpreter | default(ansible_facts['python']['executable']) }}"
tasks:

View File

@ -23,7 +23,7 @@
hosts: "{{ openstack_service_setup_host | default('localhost') }}"
gather_facts: "{{ osa_gather_facts | default(True) }}"
vars_files:
- "defaults/{{ install_method }}_install.yml"
- "defaults/{{ install_method | default('source') }}_install.yml"
become: yes
tags:
- openrc