Ok, I managed to fixed with what you and Shawn said, but why the following
happens:
When I define this in my playbook:
vars:
include: /etc/ansible/add_users/global_vars/main.yml
And then I have the following in my vars file:
---
#wheelsregex: # *%wheel *ALL=\(ALL\) *ALL
#user_password: 12345678
users:
- name: test
authorized:
- /etc/ansible/add_users/files/test.pub
- name: test1
authorized:
- /etc/ansible/add_users/files/test1.pub
- name: test2
authorized:
- /etc/ansible/add_users/files/test2.pub
user_password: 12345678
The playbook fails (the debug for vars is like my previous post).
But when I use the following in my playbook (I don't use vars in external
file), it works:
vars:
#include: /etc/ansible/add_users/global_vars/main.yml
users:
- name: test
authorized:
- /etc/ansible/add_users/files/test.pub
- name: dhristov
authorized:
- /etc/ansible/add_users/files/dhristov.pub
- name: martini
authorized:
- /etc/ansible/add_users/files/martin.pub
user_password: 12345678
Regards,
Dimitar
On Thursday, July 16, 2015 at 9:35:22 PM UTC+3, Brian Coca wrote:
>
> your debug is indicative that 'users' is undefined, that is why it is
> failing (we made the message much clearer in 2.0)
>
>
> --
> Brian Coca
>
--
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/9160d0e8-e06e-4732-a2ac-db6927894b20%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.