Ansible Environment variables

- hosts: localhost
  vars:
    kubeconfig_path: "{{ lookup('env','KUBECONFIG') }}"
    cloudflare_email: "{{ lookup('env','CF_EMAIL') }}"
export CF_EMAIL=<your_cloudflare_email>
export KUBECONFIG=~/.kube/config
ansible-playbook playbook.yml

References:

  • 1How to Inject Environment Variables into Ansible Playbooks

  1. https://graspingtech.com/ansible-environment-variables/ ↩︎

Previous
Next