Hello Michael Thanks for your answer.
users_group: - admin I did it this way, because for some hosts (like development) the development guys needs to login to. So it would be like this: users_group: - admin - development Bit I will check this out! Kind regards, Werner Op maandag 15 december 2014 13:04:41 UTC+1 schreef Michael DeHaan: > > Looks like you may want: > > when: users_group[0] in item.groups > > You may also just wish to change this: > > users_group: admin > > > > > On Sun, Dec 14, 2014 at 10:13 AM, Werner Dijkerman <[email protected] > <javascript:>> wrote: >> >> Hi there, >> >> I'm busy with an module for managing users (With public keys) for my >> work. >> >> I've got the following vars: >> >> users: >> - name: "Werner Dijkerman" >> state: present >> uid: 1000 >> gid: 1000 >> groups: >> - admin >> - simple_group >> >> users_group: >> - admin >> >> And I have the following task: >> >> - name: Check users state >> user: name="{{ item.name }}" >> state="{{ item.state }}" >> with_items: "{{ users }}" >> when: users_group in item.groups >> >> When I add the users_group var in an host_group var file (Like >> group_vars/all), the users in that specific group needs te be created on >> the host. >> >> But when I run the playbook, it keeps "skipping". >> >> What am I missing or doing wrong? I tried to use it with " >> with_subelements" but it still keep "skipping" >> >> Kind regards, >> >> Werner >> >> -- >> 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] <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/ansible-project/172fcef0-8b37-4366-94ca-7a72b70d3658%40googlegroups.com >> >> <https://groups.google.com/d/msgid/ansible-project/172fcef0-8b37-4366-94ca-7a72b70d3658%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > -- 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/2a215c6f-b5c7-4c3e-b3eb-0fff756bd17d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
