I have the env file which is present in target machine and it contain certain number of variables with export command(the export command itself was present inside the file).
export AB_HOME=/et/dev/abinitio/abinitio-V3
export PATH=${AB_HOME}/bin:${PATH}
I have executed the env file using the below playbook and I tried to read the variables which are exported using the output1 which is a register variable in my playbook. But I am able to see my register variable is empty. Is there any way to get the variables which are all exported. I don't know the variables name which are present inside the file, So I am not able to use the ECHO command.
- hosts: dev
gather_facts: false
tasks:
- name: get the environment variables
shell: "su <id> & . ./.env"
args:
chdir: /path to the file
register: output1
- debug: var=output1.stdout_lines