No its still the same,

- 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" }

=========samer error

atal: [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 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.130]: 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.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  - nam




On Monday, August 21, 2017 at 10:17:13 PM UTC+5:30, Kai Stian Olstad wrote:
>
> On 21. aug. 2017 17:29, 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" } 
> > ======================== 
>
> You indentation on with_items is wrong. 
> with_items is a property for the task and not yum_repository, so 
> indentation should be at the same level as name and yum_repository. 
>
>
> -- 
> 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/9b9fac13-3eba-4745-ae47-4538e42055eb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to