On Mon, Aug 25, 2014 at 10:11 AM, Jeff Geerling <[email protected]>
wrote:

>
>
> On Monday, August 25, 2014 9:02:13 AM UTC-5, Michael DeHaan wrote:
>
>>
>>
>> On Mon, Aug 25, 2014 at 9:49 AM, Jeff Geerling <[email protected]>
>> wrote:
>>
>>> In the documentation, and for terseness, many task examples are given
>>> like:
>>>
>>>   - apt: pkg=package_name state=installed update_cache=yes
>>>
>>> However, for version control, legibility, etc., it's usually preferred
>>> (at least as far as I've seen) to use a parameter-per-line approach, and
>>> there are two basic ways to do this with normal YAML syntax, first, with
>>> the YAML escape character and the parameters formatted the same (key=value):
>>>
>>
>> This has not been the case.
>>
>
> To each his own :) - but I've seen multiline more often than not,
> especially when tasks have 3+ parameters. Usually there's a mix, but it's
> hard to digest a task with 6+ parameters on one line.
>


My feeling is, in this day of widescreen monitors and laptops, there's
plenty of room in nearly all cases, and 79 character line wrap is obsolete.

Making more concise playbooks makes them easier to read and skim, rather
than things being several pages long.

I do believe in significant use of whitespace between lines, giving every
task a "name:" attribute, and things like that.


>
> Ah, didn't know that—it's currently displayed as one of the examples on
> the command module docs page (http://docs.ansible.com/command_module.html)
> — should I open a PR to remove that example?
>


I think this is the confusion: your args is not indented at the right level
basicaly, if you move it back to the level of command, it would be correct
and ok.



>
>>
>>>
>>> How do you deal with key-value pairs in your tasks? What is the
>>> preferred and/or most used method? From what I've seen, it's usually a bit
>>> of a hodgepodge, and there are still many playbooks, roles, and examples
>>> out there with one-line tasks which are impossible to read/maintain unless
>>> extremely simple.
>>>
>>
>> All are valid, though the form you have with ">" is less desirable than
>> passing a dictionary when you are already breaking things up into multiple
>> lines.
>>
>
> True!
>
> Thanks for the input,
> Jeff Geerling
>
> --
> 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/37a5f704-409d-4e0a-98b8-9c0ad290a264%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/37a5f704-409d-4e0a-98b8-9c0ad290a264%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/CA%2BnsWgzcdRBfw6R0irktdEaiL2Qa5pK55zD%2BKZn80aw2a_EFFQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to