I am using version 1.3.3
Here is the main playbook with a simple experiment to set the variable
"centos-6.4" to the image id. I would prefer to do it with a role variable
file or include, but this eliminates any other issues and just highlights
the variable substitution:
--
*- hosts: AdminVM*
* connection: local*
* gather_facts: false*
* vars:*
* centos-6.4: 52225cb3-441b-47b6-9cca-deb14d24d72f*
* roles:*
* - provision*
* vars:*
* hostlist:*
* - { hostname: 'test-vm', groups: 'test-vm', image_id:
'{{centos-6.4}}', security_group: 'default', flavor: 'n1.tiny' }*
This throws python errors:
*> ansible-playbook -i hosts vm.yml*
*Traceback (most recent call last):*
* File "/usr/bin/ansible-playbook", line 268, in <module>*
* sys.exit(main(sys.argv[1:]))*
* File "/usr/bin/ansible-playbook", line 208, in main*
* pb.run()*
* File "/usr/lib/pymodules/python2.7/ansible/playbook/__init__.py", line
228, in run*
* play = Play(self, play_ds, play_basedir)*
* File "/usr/lib/pymodules/python2.7/ansible/playbook/play.py", line 90,
in __init__*
* ds = template(basedir, ds, self.vars)*
* File "/usr/lib/pymodules/python2.7/ansible/utils/template.py", line 332,
in template*
* d[k] = template(basedir, v, vars, lookup_fatal, depth, expand_lists,
fail_on_undefined=fail_on_undefined)*
* File "/usr/lib/pymodules/python2.7/ansible/utils/template.py", line 332,
in template*
* d[k] = template(basedir, v, vars, lookup_fatal, depth, expand_lists,
fail_on_undefined=fail_on_undefined)*
* File "/usr/lib/pymodules/python2.7/ansible/utils/template.py", line 328,
in template*
* return [template(basedir, v, vars, lookup_fatal, depth, expand_lists,
fail_on_undefined=fail_on_undefined) for v in varname]*
* File "/usr/lib/pymodules/python2.7/ansible/utils/template.py", line 332,
in template*
* d[k] = template(basedir, v, vars, lookup_fatal, depth, expand_lists,
fail_on_undefined=fail_on_undefined)*
* File "/usr/lib/pymodules/python2.7/ansible/utils/template.py", line 310,
in template*
* varname = template_from_string(basedir, varname, vars,
fail_on_undefined)*
* File "/usr/lib/pymodules/python2.7/ansible/utils/template.py", line 512,
in template_from_string*
* res =
jinja2.utils.concat(t.root_render_func(t.new_context(_jinja2_vars(basedir,
vars, t.globals, fail_on_undefined), shared=True)))*
* File "<template>", line 8, in root*
On Thu, Jan 16, 2014 at 2:31 PM, Brian Coca <[email protected]> wrote:
> FYI, { key: value } denotes a hash/dictionary, lists are [ element1,
> element2 ], both should be templateable depending on context.
>
>
> --
> Brian Coca
> Stultorum infinitus est numerus
>
> 0110000101110010011001010110111000100111011101000010000001111001011011110111010100100000011100110110110101100001011100100111010000100001
> Pedo mellon a minno
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Ansible Project" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/ansible-project/e4EUX3CbGso/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To post to this group, send email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
--
Albion Baucom
gRED IT Support
Pharma Informatics
--
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].
For more options, visit https://groups.google.com/groups/opt_out.