[ansible-project] Re: Unable to figure out arrays

2014-10-09 Thread Michael Bushey
Please ignore the second mail: under bob -- 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-project+unsubscr...@googlegroups.com. To post to this group,

[ansible-project] Re: Unable to figure out arrays

2014-10-09 Thread mvermaes
Hi Michael, I think you want something like: --- - name: Set up users hosts: localhost gather_facts: no vars: users: alice: name: Alice Appleworth mail: al...@appleworth.com pass: ..hash... bob: name: Bob Bananarama mail: b...@bananara

Re: [ansible-project] Re: Unable to figure out arrays

2014-10-09 Thread Michael Bushey
Thanks for your response Michael. I've already read through that page a few times. It does not work for me because I need an array of users, and then I need to be able to select which user have access to each class of server. This method would give every user access to every machine. I need to be

Re: [ansible-project] Re: Unable to figure out arrays

2014-10-10 Thread Brian Coca
for that just do : vars: allowed_users_host1: ['alice,'bob'] - name: Add user debug: msg="Add user {{ item.key }} password {{ item.value.pass }}" with_dict: users when: item.key in allowed_users_host1 On Fri, Oct 10, 2014 at 2:59 AM, Michael Bushey wrote:

Re: [ansible-project] Re: Unable to figure out arrays

2014-10-10 Thread Adam Heath
- name: foo shell: echo "{{ users[item].name }}" with_items: - alice - bob On 10/10/2014 01:59 AM, Michael Bushey wrote: Thanks for your response Michael. I've already read through that page a few times. It does not work for me because I need an array of users, and then I need to be a

Re: [ansible-project] Re: Unable to figure out arrays

2014-10-10 Thread Michael Bushey
Awesome! Thank you so much for your responses Michael, Brian, and Adam. Both solutions from Brian and Adam work, thank you! If any of you get to Los Angeles I owe you a drink! This is working great: - name: Users | create .gitconfig shell: git config --global user.name '{{ item.value.name }