Module examples should be in YAML format

Given that Ansible best practices say to use YAML format, our
documentation should not make the excuse that it's too hard,
but rather represent examples in YAML format.

This will allow those using the examples to instantly see
best practices
pull/18048/head
Will Thames 8 years ago committed by Toshio Kuratomi
parent 77e7ae6838
commit c661f9f561

@ -426,13 +426,13 @@ for URL, module, italic, and constant-width respectively. It is suggested
to use ``C()`` for file and option names, and ``I()`` when referencing
parameters; module names should be specified as ``M(module)``.
Examples (which typically contain colons, quotes, etc.) are difficult
to format with YAML, so these must be
written in plain text in an ``EXAMPLES`` string within the module
like this::
Examples should be written in YAML format in plain text in an
``EXAMPLES`` string within the module like this::
EXAMPLES = '''
- action: modulename opt1=arg1 opt2=arg2
- modulename:
opt1: arg1
opt2: arg2
'''
The EXAMPLES section, just like the documentation section, is required in

@ -432,13 +432,13 @@ for URL, module, italic, and constant-width respectively. It is suggested
to use ``C()`` for file and option names, and ``I()`` when referencing
parameters; module names should be specified as ``M(module)``.
Examples (which typically contain colons, quotes, etc.) are difficult
to format with YAML, so these must be
written in plain text in an ``EXAMPLES`` string within the module
like this::
Examples should be written in YAML format in plain text in an
``EXAMPLES`` string within the module like this::
EXAMPLES = '''
- action: modulename opt1=arg1 opt2=arg2
- modulename:
opt1: arg1
opt2: arg2
'''
The EXAMPLES section, just like the documentation section, is required in

Loading…
Cancel
Save