Hi,
I am trying to create a role in which i have variable file ( main.yml) under vars folder containing
---
group1:
cid: t1234
env: uat
status: active
and in the tasks (main.yml ) i have
---
- name: setting values
set_fact:
cid: "{{item.cid}}"
env : "{{item.env}}"
with_items: "{{ group1}}"
****other lines*********
but when i run the ansible-playbook --syntax-check for task file i get the error
#ansible-playbook -syntax-check tasks/main.yml
ERROR! 'with_items' is not a valid attribute for a Play
The offending line appears to be:
---
- name: setting values
^ here
Could you please let know where we are going wrong ,also if we can use set_fact with with_items or with_dict.