On Wednesday, 31 January 2018 18.36.20 CET richard d wrote:
> I'm using yamllint to validate my code and its telling me my line is too 
> long - read many posts online, and can't understand how to fix this.

You don't need to fix it, Ansible doesn't care about how long a lines is.


> - name: copy multiple items into multiple locations
>   copy:
>       src: "{{ item.src }}"
>       dest: "{{ item.dest }}"
>       owner: "{{ item.owner }}"
>       mode: "{{ item.mode }}"
>   with_items:
>       - {src: '/home/user/motd', dest: '/etc/motd', owner: "root", mode: 
> '0644'}
>       - {src: '/home/user/file', dest: '/etc/file', owner: "root", mode: 
> '0600'}
> 
> 
> How can i take the last two lines and have them over two lines each?

One way to write it is like this:

  with_items:
      - src: '/home/user/motd'
        dest: '/etc/motd'
        owner: "root"
        mode: '0644'
      - src: '/home/user/file'
        dest: '/etc/file'
        owner: "root"
        mode: '0600'


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

Reply via email to