ansible-devops icon indicating copy to clipboard operation
ansible-devops copied to clipboard

[Ansible] - Allow to provide ansible variables via inventory instead of environment variable

Open Delgon opened this issue 1 year ago • 0 comments

Feature and motivation

Currently, playbooks and some ansible roles load their variables from environment variables (eg: mas_app_channel: "{{ lookup('env', 'MAS_APP_CHANNEL') | default('9.0.x', true) }}")

To follow ansible best practices and also allow to use playbooks & roles from a classic ansible method via inventories. It would be necessary to unlock the loading of these variables so that we can provide them via inventory OR environment variable.

Usage example

https://docs.ansible.com/ansible/latest/inventory_guide/intro_inventory.html#inventory-basics-formats-hosts-and-groups

Delgon avatar Sep 26 '24 09:09 Delgon