On Thu, Jan 31, 2013 at 2:19 PM, Andrew Berman <
atbe...@gmail.com> wrote:
> Hello,
>
> I'm new to Ansible and I'm not sure if this is a bug or if I'm doing
> something wrong. I currently have a playbook which has vars_prompt and
> vars_files in it and no matter what I do, I get a Python error. Here is
> the playbook:
Ok, this is the classic computer error of an error being raised while
it is trying to tell you what the actual error really was.
It looks like you want to do
- name:
as opposed to
- (newline)
name:
at least at first glance.
We should definitely intercept the error condition such that we don't
give you a traceback in that case, so that itself is a bug. Can you
file one and make sure the playbook you used to reproduce it is in the
ticket?
Otherwise, fixing the format error should make the error (and the
traceback) disappear. Using vars_files/vars_prompt together is
definitely legal.
Hope that helps!
--Michael
>
> ---
>
> -
> hosts: $hosts
>
> user: root
>
> vars_prompt:
> -
> name: pg_port
> prompt: "What port should Postgres run on?"
> private: no
> default: 5432
>
> vars_files:
> - vars/postgres.yml
> - vars/global_vars.yml
>
> It works only when I comment out the entire vars_files block. Here is the
> Python error:
>
> Traceback (most recent call last):
> File "/usr/bin/ansible-playbook", line 177, in <module>
> sys.exit(main(sys.argv[1:]))
> File "/usr/bin/ansible-playbook", line 148, in main
> pb.run()
> File "/usr/lib/python2.6/site-packages/ansible/playbook/__init__.py", line
> 192, in run
> play = Play(self, play_ds, play_basedir)
> File "/usr/lib/python2.6/site-packages/ansible/playbook/play.py", line 83,
> in __init__
> self._update_vars_files_for_host(None)
> File "/usr/lib/python2.6/site-packages/ansible/playbook/play.py", line
> 300, in _update_vars_files_for_host
> raise errors.AnsibleError("%s must be stored as dictonary/hash: %s" %
> filename4)
> TypeError: not enough arguments for format string
>
> Can anyone help me?
>
> Thanks,
>
> Andrew
>
> --
> 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
ansible-proje...@googlegroups.com.
> For more options, visit
https://groups.google.com/groups/opt_out.
>
>