# Line too long, need to break over two lines -

**URL:** <https://forum.ansible.com/t/line-too-long-need-to-break-over-two-lines/26616>\
**Category:** Ansible Project\
**Created:** [January 31, 2018, 5:36pm UTC](https://forum.ansible.com/t/line-too-long-need-to-break-over-two-lines/26616 "2018-01-31T17:36:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rckd02](https://avatars.discourse-cdn.com/v4/letter/r/91b2a8/32.png) [@rckd02](https://forum.ansible.com/u/rckd02)\
**Post date:** [January 31, 2018, 5:36pm UTC](https://forum.ansible.com/t/line-too-long-need-to-break-over-two-lines/26616/1 "2018-01-31T17:36:20Z")

</div>

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.

- 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?

thank you 🙂  
Rick

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [January 31, 2018, 6:13pm UTC](https://forum.ansible.com/t/line-too-long-need-to-break-over-two-lines/26616/2 "2018-01-31T18:13:40Z")

</div>

> 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  
> &nbsp;&nbsp;copy:  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;src: "{{ item.src }}"  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dest: "{{ item.dest }}"  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;owner: "{{ item.owner }}"  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mode: "{{ item.mode }}"  
> &nbsp;&nbsp;with\_items:  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- {src: '/home/user/motd', dest: '/etc/motd', owner: "root", mode:  
> '0644'}  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- {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:

&nbsp;&nbsp;with\_items:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- src: '/home/user/motd'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dest: '/etc/motd'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;owner: "root"  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mode: '0644'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- src: '/home/user/file'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dest: '/etc/file'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;owner: "root"  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mode: '0600'
