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
(cherry picked from commit f05c90103c
)
This commit is contained in:
parent
76579b0738
commit
e0c3efb14b
|
@ -7,3 +7,6 @@ warn_list:
|
||||||
- unnamed-task
|
- unnamed-task
|
||||||
- no-handler
|
- no-handler
|
||||||
- var-naming
|
- var-naming
|
||||||
|
|
||||||
|
extra_vars:
|
||||||
|
openstack_service_setup_host: utility_all
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
hosts: "{{ openstack_service_setup_host | default('localhost') }}"
|
hosts: "{{ openstack_service_setup_host | default('localhost') }}"
|
||||||
user: root
|
user: root
|
||||||
vars_files:
|
vars_files:
|
||||||
- "defaults/{{ install_method }}_install.yml"
|
- "defaults/{{ install_method | default('source') }}_install.yml"
|
||||||
vars:
|
vars:
|
||||||
ansible_python_interpreter: >-
|
ansible_python_interpreter: >-
|
||||||
{{ openstack_service_setup_host_python_interpreter |
|
{{ openstack_service_setup_host_python_interpreter |
|
||||||
|
|
|
@ -99,7 +99,7 @@
|
||||||
hosts: "{{ openstack_service_setup_host | default('localhost') }}"
|
hosts: "{{ openstack_service_setup_host | default('localhost') }}"
|
||||||
gather_facts: no
|
gather_facts: no
|
||||||
vars_files:
|
vars_files:
|
||||||
- "defaults/{{ install_method }}_install.yml"
|
- "defaults/{{ install_method | default('source') }}_install.yml"
|
||||||
vars:
|
vars:
|
||||||
ansible_python_interpreter: "{{ openstack_service_setup_host_python_interpreter | default(ansible_facts['python']['executable']) }}"
|
ansible_python_interpreter: "{{ openstack_service_setup_host_python_interpreter | default(ansible_facts['python']['executable']) }}"
|
||||||
tasks:
|
tasks:
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
hosts: "{{ openstack_service_setup_host | default('localhost') }}"
|
hosts: "{{ openstack_service_setup_host | default('localhost') }}"
|
||||||
gather_facts: "{{ osa_gather_facts | default(True) }}"
|
gather_facts: "{{ osa_gather_facts | default(True) }}"
|
||||||
vars_files:
|
vars_files:
|
||||||
- "defaults/{{ install_method }}_install.yml"
|
- "defaults/{{ install_method | default('source') }}_install.yml"
|
||||||
become: yes
|
become: yes
|
||||||
tags:
|
tags:
|
||||||
- openrc
|
- openrc
|
||||||
|
|
|
@ -145,7 +145,7 @@ elif [[ "${ACTION}" == "linters" ]]; then
|
||||||
else
|
else
|
||||||
ROLE_DIR="${OSA_CLONE_DIR}"
|
ROLE_DIR="${OSA_CLONE_DIR}"
|
||||||
${VENV_BIN_DIR}/ansible-lint playbooks/ --exclude /etc/ansible/roles
|
${VENV_BIN_DIR}/ansible-lint playbooks/ --exclude /etc/ansible/roles
|
||||||
ansible-playbook --syntax-check --list-tasks playbooks/setup-everything.yml
|
ansible-playbook --syntax-check --list-tasks playbooks/setup-everything.yml -e openstack_service_setup_host=utility_all
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Run bashate
|
# Run bashate
|
||||||
|
|
Loading…
Reference in New Issue