I have in my playbook this var:
- name: Deploy nodejs app
vars:
nodejs:
name: myapp
version: 0.1.1
settings:
port: 3000
log: /var/log
I want to replace or override version and port in this nodejs variable at
runtime. I've tried:
1. --extra-vars 'nodejs.version=0.1.2 nodejs.settings.port=4000'
2. --extra-vars 'nodejs["version"]=0.1.2 nodejs["settings"]["port"]=4000'
3. --extra-vars '{"nodejs": {"version": "0.1.2", "settings": {"port":
4000}}}'
None of them worked. In 1) and 2), the values of version and port are not
passed in, and in 3), nodejs variable was entirely replaced so that all the
other values like name and log are gone.
So is there a way to use --extra-vars to override part of a complex
variable?
Thanks.
--
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/5ee29a64-fcce-4aba-8780-5f4ca59ea216%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.