Open Fernien opened 1 month ago
in Plain Ansible i would use host_vars & group_vars see also https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_variables.html
Semaphore load them from your Repository.
If you need to set them via Semaphore Environment (aka --extra-vars): Lets say you have a variable foo with default bar. on Server2 you want foo with value baz:
Inventory(ini):
Server1
Server2
Semaphore Environment (json):
{
"host_specific_foo": {
"Server2": "baz"
},
"foo": "{{ host_specific_foo[inventory_hostname] | default('bar', true) }}"
}
Question
Hey,
I'm running an ansible playbook via the semaphoreui. My variables are defined in the "Environment Variables" section. My problem is that i need to overwrite some of the variables for specific hosts. I tried setting the variable via the inventory.
My inventory looks like this:
but the variable gets ignored/overwritten by Environment Variables tab. Haven't found a different way yet. How can i set host specific variables?
Grateful for every tip you can give me.
Related to
Ansible (task execution), Configuration