--- # Copyright 2019 Red Hat, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. - name: set basic user fact set_fact: ansible_user: "{{ lookup('env', 'USER') }}" when: - ansible_user is undefined - name: set basic home fact set_fact: ansible_user_dir: "{{ lookup('env', 'HOME') }}" when: - ansible_user_dir is undefined - name: set calling_ansible_environment_variables fact set_fact: calling_ansible_environment_variables: [] when: - (not ceph_ansible_inherits_calling_ansible_environment | default(true)) | bool - name: Local environment inherit when: - (ceph_ansible_inherits_calling_ansible_environment | default(false)) | bool block: - name: get all ansible environment variables shell: "env | grep ^ANSIBLE_ | grep -v CALLBACK" register: env_shell_output failed_when: false delegate_to: localhost connection: local run_once: true - name: set calling_ansible_environment_variables run_once: true 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 - name: Set common fact set_fact: ceph_common_done: true - name: set ceph_ansible_limit to ansible_limit, only if ansible_limit defined set_fact: ceph_ansible_limit: "{{ ansible_limit }}" when: - (ceph_ansible_limit is not defined) or (ceph_ansible_limit|length == 0) - (ansible_limit is defined) and (ansible_limit|length > 0)