Hello Todd, understand, using variables in minuscules.
<https://stackoverflow.com/posts/74707194/timeline>
i need to automate the installation of a docker plugin using ansible.
- name: "install plugin"
hosts: localhost
gather_facts: no
vars:
new:
url: newurl
user: user
pass: pass
old:
url: oldurl
tasks:
- debug:
msg: docker install pluginame HOST='{% if server=="new" %}{{ new.url
}}{% elif server=="old" %}{{ old.url }}{% endif %}'
I don’t know if it’s the best way to handle it because the user variable
and password are exposed in the playbook.
I cannot understand how to compare the "server" console variable with the
url key within each array and I also need to add a conditional in each task
to run it if the url key matches the value of the "server" variable.
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/CAGUDtnn1UFpvX74ksKW28dpN0vcGRQoVHJkVMOJUcJ87y0P3hw%40mail.gmail.com.