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


On Fri, Mar 14, 2014 at 11:11 AM, Jack Neely <[email protected]> wrote:

> 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
>
> --
> 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/0d737fbc-50b5-45a1-b6d8-d6ffc3c21a43%40googlegroups.com<https://groups.google.com/d/msgid/ansible-project/0d737fbc-50b5-45a1-b6d8-d6ffc3c21a43%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAEVJ8QMZO%3D%2BGZ6U2f7V3NAcA7tVDA%2BtWxstZGmgXy6DFX4oGKg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to