Reading multiple values from an env file with ansible and storing them as facts
问题 I have the following code which reads values from an environment (.env) file and stores them as facts: - name: Read values from environment shell: "source {{ env_path }}; echo $DB_PASSWORD" register: output args: executable: /bin/bash changed_when: false - name: Store read password set_fact: db_password: "{{ output.stdout }}" when: - db_password is undefined changed_when: false - name: Read values from environment shell: "source {{ env_path }}; echo $DB_USER" register: output args: executable