How to set Linux environment variables with Ansible
There are multiple ways to do this and from your question it’s nor clear what you need. 1. If you need environment variable to be defined PER TASK ONLY, you do this: – hosts: dev tasks: – name: Echo my_env_var shell: “echo $MY_ENV_VARIABLE” environment: MY_ENV_VARIABLE: whatever_value – name: Echo my_env_var again shell: “echo $MY_ENV_VARIABLE” Note … Read more