Re: [ansible-project] when: state is present from variable dict hash list

2016-03-19 Thread 'Chris Short' via Ansible Project
Thank you, bcoca. Helpful as always! On Friday, March 18, 2016 at 9:48:22 AM UTC-4, Brian Coca wrote: > > you are referencing it incorrectly, staff is a list not a dictionary, also > I think you want the "current item's state": > > when: item.state == 'present' > > assuming you want to execute th

Re: [ansible-project] when: state is present from variable dict hash list

2016-03-19 Thread Brian Coca
you are referencing it incorrectly, staff is a list not a dictionary, also I think you want the "current item's state": when: item.state == 'present' assuming you want to execute the task only for those entries that have that state. -- Brian Coca -- You received this message because y

[ansible-project] when: state is present from variable dict hash list

2016-03-18 Thread 'Chris Short' via Ansible Project
I have the following defined in group_vars and I'm trying to run a task when the state is defined as present and the syntax is baffling me: staff: - { netid: user001, uid: 12345, comment: "Chris Short", state: present } - { netid: user002, uid: 12346, comment: "Bob Jones", state: absent } Th