Merge "Inherit calling Ansible's environment when running ceph-ansible"
This commit is contained in:
commit
9204dbce60
@ -144,3 +144,4 @@ openstack_config: true
|
||||
pools: []
|
||||
ntp_service_enabled: false
|
||||
generate_fsid: false
|
||||
ceph_ansible_inherits_calling_ansible_environment: true
|
||||
|
@ -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
|
||||
|
@ -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/
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user