Set calling_ansible_environment_variables after preset vars

This patch moves calling_ansible_environment_variables after the preset
vars when constructing the ansible-playbook commands for ceph-ansible.

This makes it so that variables set on the command line take precedence
over what is set by these roles. For example, setting a customer
ANSIBLE_CONFIG on the command line would now have that value passed to
the ansible-playbook commands used for ceph-ansible, when previously it
would have been overridden as {{ playbook_dir }}/ansible.cfg.

Change-Id: I2a91ca1aa91d91f6f525f2fba0b093c7ec216e1d
This commit is contained in:
James Slagle 2019-10-03 17:00:56 -04:00
parent 1711c432d7
commit 47a055558d
2 changed files with 2 additions and 2 deletions

View File

@ -26,7 +26,6 @@
- name: set ceph-ansible command list
set_fact:
ceph_ansible_command_list:
- "{{ calling_ansible_environment_variables|join(' ') }}"
- ANSIBLE_ACTION_PLUGINS=/usr/share/ceph-ansible/plugins/actions/
- ANSIBLE_CALLBACK_PLUGINS=/usr/share/ceph-ansible/plugins/callback/
- ANSIBLE_ROLES_PATH=/usr/share/ceph-ansible/roles/
@ -36,6 +35,7 @@
- ANSIBLE_REMOTE_TEMP=/tmp/ceph_ansible_tmp
- ANSIBLE_FORKS=25
- ANSIBLE_GATHER_TIMEOUT=60
- "{{ calling_ansible_environment_variables|join(' ') }}"
- "{{ ceph_ansible_environment_variables|join(' ') }}"
- ansible-playbook
- '{% if ceph_ansible_private_key_file is defined %}--private-key {{ ceph_ansible_private_key_file }}{% endif %}'

View File

@ -17,11 +17,11 @@
- name: build nodes-uuid command as list
set_fact:
nodes_uuid_list:
- "{{ calling_ansible_environment_variables|join(' ') }}"
- ANSIBLE_LOG_PATH="{{ playbook_dir }}/ceph-ansible/nodes_uuid_command.log"
- ANSIBLE_SSH_CONTROL_PATH_DIR="{{ playbook_dir }}/ceph-ansible/"
- ANSIBLE_CONFIG="{{ playbook_dir }}/ansible.cfg"
- ANSIBLE_REMOTE_TEMP=/tmp/nodes_uuid_tmp
- "{{ calling_ansible_environment_variables|join(' ') }}"
- "{{ ceph_ansible_environment_variables|join(' ') }}"
- ansible-playbook
- '{% if ceph_ansible_private_key_file is defined %}--private-key {{ ceph_ansible_private_key_file }}{% endif %}'