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 }
The play is like this:
- name: Do Something
shell: script.sh
with_items: - “{{ oristaff }}”
when: ori_staff.state == ‘present’
I’ve tried several different ways to ascertain state and none of them have worked so far.