Merge "Inherit calling Ansible's environment when running ceph-ansible"

This commit is contained in:
Zuul 2019-08-09 14:09:52 +00:00 committed by Gerrit Code Review
commit 9204dbce60
4 changed files with 22 additions and 0 deletions

View File

@ -144,3 +144,4 @@ openstack_config: true
pools: []
ntp_service_enabled: false
generate_fsid: false
ceph_ansible_inherits_calling_ansible_environment: true

View File

@ -43,3 +43,22 @@
ansible_user_dir: "{{ lookup('env', 'HOME') }}"
when:
- ansible_user_dir is undefined
- name: set default for calling_ansible_environment_variables
set_fact:
calling_ansible_environment_variables: []
- when: ceph_ansible_inherits_calling_ansible_environment
block:
- name: get all ansible environment variables
shell: "env | grep ANSIBLE_"
register: env_shell_output
ignore_errors: true
- name: set calling_ansible_environment_variables
set_fact:
calling_ansible_environment_variables: "{{ env_shell_output.stdout_lines }}"
when:
- env_shell_output.rc is defined
- env_shell_output.rc == 0
- env_shell_output.stdout_lines is defined
- (env_shell_output.stdout_lines|length) > 0

View File

@ -26,6 +26,7 @@
- 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/

View File

@ -17,6 +17,7 @@
- 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"