It looks like your spacing is off.  Add another space to your hashes under 
with_items.

      with_items:
       - { href: "
http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm";, 
repo: "/etc/yum.repos.d/epel.repo" }
       - { href: "
http://rpms.famillecollet.com/enterprise/remi-release-7.rpm";, repo: 
"/etc/yum.repos.d/remi.repo" }

On Monday, August 21, 2017 at 10:29:38 AM UTC-5, Sameer Modak wrote:
>
>  hosts: all
>   tasks:
>   - name: "install EPEL and Remi reps"
>     yum_repository:
>       name: "{{ item.href }}"
>       basurl: "{{ item.repo }}"
>       with_items:
>       - { href: "
> http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm";, 
> repo: "/etc/yum.repos.d/epel.repo" }
>       - { href: "
> http://rpms.famillecollet.com/enterprise/remi-release-7.rpm";, repo: 
> "/etc/yum.repos.d/remi.repo" }
> ========================
>
> We are getting below error, cant understand whats the issue
> fatal: [192.168.211.131]: FAILED! => {"failed": true, "msg": "the field 
> 'args' has an invalid value, which appears to include a variable that is 
> undefined. The error was: 'item' is undefined\n\nThe error appears to have 
> been in '/etc/ansible/lamp.yml': line 3, column 5, but may\nbe elsewhere in 
> the file depending on the exact syntax problem.\n\nThe offending line 
> appears to be:\n\n  tasks:\n  - name: \"install EPEL and Remi reps\"\n    ^ 
> here\n"}
> fatal: [192.168.211.129]: FAILED! => {"failed": true, "msg": "the field 
> 'args' has an invalid value, which appears to include a variable that is 
> undefined. The error was: 'item' is undefi
>
>
>

-- 
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, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/dfefb2cd-a5a4-4254-a813-b216ad88cccc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to