On Sunday, 30 September 2018 19.46.12 CEST coach rhca wrote:
> 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*

ansible-playbook --syntax-check can only check syntax on playbooks, not task 
files.

If you have a playbook that include the role it will check the syntax on the 
role.


-- 
Kai Stian Olstad


-- 
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/39446127.Q3cXPdm5SL%40x1.
For more options, visit https://groups.google.com/d/optout.

Reply via email to