'How to set multiple variables to be used in an ansible task using local commands
I have a deployment playbook and I want to see some info of the artifact being deployed. For that I created the following task
- name: Print application info
debug:
msg: "Version to be deployed is {{ app_version }} built on {{ app_build_date }}. Jar md5 is {{ app_md5 }}"
verbosity: 1
What is the best way to define the value of all those variables? The artifact to be deployed is locally accessible in the control node. I don't want to have to create one task to set (register) each variable via the command module. I also looked into local facts but IIUC, that means I would need to create another separate play to gather the facts, plus the solution is not self-contained since I would need to manage local files in /etc/ansible/facts.d in the control node outside of ansible's control.
Is there a way that is self-contained/managed by ansible?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
