module_formatter: .rst now correctly handles code examples
- fixed template (it was the template), adding indentation with Jinja2 - added description of code examples to man-page template (was missing) - fixed fireball, cron, and debug module examples to confrom
This commit is contained in:
parent
556799a7c4
commit
575459465e
5 changed files with 12 additions and 7 deletions
|
@ -46,6 +46,10 @@
|
||||||
.SH EXAMPLES
|
.SH EXAMPLES
|
||||||
{% for e in examples %}
|
{% for e in examples %}
|
||||||
.PP
|
.PP
|
||||||
|
{% if e['description'] %}
|
||||||
|
@{ e['description'] | jpfunc }@
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
.nf
|
.nf
|
||||||
@{ e['code'] }@
|
@{ e['code'] }@
|
||||||
.fi
|
.fi
|
||||||
|
|
|
@ -45,9 +45,11 @@
|
||||||
|
|
||||||
{% for example in examples %}
|
{% for example in examples %}
|
||||||
{% if example['description'] %}<p>@{ example['description'] | html_ify }@</p>{% endif %}
|
{% if example['description'] %}<p>@{ example['description'] | html_ify }@</p>{% endif %}
|
||||||
<p><pre>
|
<p>
|
||||||
@{ example['code'] }@
|
<pre>
|
||||||
</pre></p>
|
@{ example['code'] | indent(4, True) }@
|
||||||
|
</pre>
|
||||||
|
</p>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
|
|
|
@ -101,7 +101,7 @@ options:
|
||||||
examples:
|
examples:
|
||||||
- code: cron name="check dirs" hour="5,2" job="ls -alh > /dev/null"
|
- code: cron name="check dirs" hour="5,2" job="ls -alh > /dev/null"
|
||||||
description: Ensure a job that runs at 2 and 5 exists. Creates an entry like "* 5,2 * * ls -alh > /dev/null"
|
description: Ensure a job that runs at 2 and 5 exists. Creates an entry like "* 5,2 * * ls -alh > /dev/null"
|
||||||
- code: name="an old job" cron job="/some/dir/job.sh" state=absent
|
- code: cron name="an old job" cron job="/some/dir/job.sh" state=absent
|
||||||
description: 'Ensure an old job is no longer present. Removes any job that is preceded by "#Ansible: an old job" in the crontab'
|
description: 'Ensure an old job is no longer present. Removes any job that is preceded by "#Ansible: an old job" in the crontab'
|
||||||
requirements: cron
|
requirements: cron
|
||||||
author: Dane Summers
|
author: Dane Summers
|
||||||
|
|
|
@ -48,7 +48,7 @@ options:
|
||||||
required: false
|
required: false
|
||||||
default: "no"
|
default: "no"
|
||||||
examples:
|
examples:
|
||||||
- code:
|
- code: |
|
||||||
- local_action: debug msg="System $inventory_hostname has uuid $ansible_product_uuid"
|
- local_action: debug msg="System $inventory_hostname has uuid $ansible_product_uuid"
|
||||||
- local_action: debug msg="System $inventory_hostname lacks a gateway" fail=yes
|
- local_action: debug msg="System $inventory_hostname lacks a gateway" fail=yes
|
||||||
only_if: "is_unset('${ansible_default_ipv4.gateway}')"
|
only_if: "is_unset('${ansible_default_ipv4.gateway}')"
|
||||||
|
|
|
@ -51,7 +51,6 @@ examples:
|
||||||
sudo: yes
|
sudo: yes
|
||||||
tasks:
|
tasks:
|
||||||
- action: fireball
|
- action: fireball
|
||||||
|
|
||||||
- hosts: devservers
|
- hosts: devservers
|
||||||
connection: fireball
|
connection: fireball
|
||||||
tasks:
|
tasks:
|
||||||
|
|
Loading…
Reference in a new issue