# Documented Syntax with Modules

**URL:** <https://forum.ansible.com/t/documented-syntax-with-modules/14773>\
**Category:** Ansible Project\
**Created:** [March 14, 2014, 3:11pm UTC](https://forum.ansible.com/t/documented-syntax-with-modules/14773 "2014-03-14T15:11:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jack\_Neely](https://avatars.discourse-cdn.com/v4/letter/j/ee7513/32.png) [@Jack\_Neely](https://forum.ansible.com/u/Jack_Neely)\
**Post date:** [March 14, 2014, 3:11pm UTC](https://forum.ansible.com/t/documented-syntax-with-modules/14773/1 "2014-03-14T15:11:29Z")

</div>

Greetings,

The documentation always uses the following syntax style when talking about or giving examples of module usage:

- name: Set up /tmp/timings file  
lineinfile: \>  
dest=/tmp/timings line=“{{ ansible\_local.preferences.launch\_msg }}” create=yes

I’ve had issues in the past when I had a long list of arguments, a loop/templating, and the need to YAML escape a character or two. I ended up with quotes around the entire argument block and had difficulty getting the escape to work, the templating to work, and have the whole scalar parsable by Ansible. Then I found that the following syntax works:

- name: Set up /tmp/timings file  
lineinfile:  
dest: /tmp/timings  
line: “{{ ansible\_local.preferences.launch\_msg }}”  
create: yes

Which just makes a ton more sense. Easier to write and read. Got to be easier to parse.

Is there a reason the latter isn’t the suggested/recommended syntax?

Jack Neely

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [March 17, 2014, 1:49pm UTC](https://forum.ansible.com/t/documented-syntax-with-modules/14773/2 "2014-03-17T13:49:25Z")

</div>

Hi Jack!

No real reason, the older single-line forms came first and I think some of us like more compact playbooks.

It’s something of a stylistic choice.

–Michael
