Pros and cons of module argument syntax styles?

INI style

 - module: >
     key1=val1
     key2=val2
     key3=val3
     key4=val4


yaml style

 - module:
     key1: val1
     key2: val2
     key3: val3
     key4: val4

Real world examples here: https://gist.github.com/sprin/fc0ddcdfa330aa93facc

With both styles, we can get one keyword/value pair per line, which is very
fast to scan and good for diffs.

The yaml style requires you to quote templated-in params, which makes them
stand out nicely with highlighting. Other than that, the two syntaxes are
functionally equivalent, no?

The INI style allows one-liners, but...

Let's be honest, this is terrible to read, bad for diffs, and we should
avoid it:

 - module: key1=val1 key2=val2 key3=val key4=val4

I suspect this may have been discussed before, but a search on this group
turned up nothing. Apologies if this has already been discussed!

Aside:

The more I work with Ansible syntax, the more I appreciate it's key strength
is how clean and quick to read it is. Simple, concise, self-documenting 
infrastructure... config has come out of the dark ages.

Nod to puppet/chef for getting things rolling in the right direction, but 
omg,
what a syntactical abomination puppet is. and chef cookbooks always end up
a laughable tangle of poorly written ruby.

-- 
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/18e75bac-7eed-404e-8933-aed180780d86%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to