-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathansible-docs.j2
80 lines (60 loc) · 1.72 KB
/
ansible-docs.j2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
{% if heading is defined %}
# {{ heading }}
{% endif %}
{% if subheading is defined %}
### *{{ subheading }}*
{% endif %}
---
### Requirements
{% if requirements is defined %}
{% for req in requirements %}
* {{ req }}
{% endfor %}
{% endif %}
---
### Modules
{% for doc in modules.results %}
* [{{ doc['module'] }} - {{ doc['short_description'].lower() }}](#{{ doc['module'] }})
{% endfor %}
---
{% for doc in modules.results %}
## {{ doc['module'] }}
{{ doc['short_description'] }}
* Synopsis
* Options
* Examples
#### Synopsis
{% for each in doc['description'] %} {{ each }}
{% endfor %}
#### Options
| Parameter | required | default | choices | comments |
| ------------- |-------------| ---------|----------- |--------- |
{% for k,v in doc.iteritems() %}
{% if k == 'options' %}
{% for option,values in v.iteritems() %}
| {{ option }} | {% if values.get('required') != None %} {{ values['required'] | replace('True','yes') | replace('False','no') }} {% endif %} | {% if values.get('default') != None %} {{ values['default'] | replace('None','')}} {% endif %} |{% if values.get('choices') != None %} <ul>{% for each in values['choices'] %} <li>{{ each }}</li> {% endfor %}</ul>{% endif %} | {% if values.get('description') != None %}{% for each in values['description'] %} {{ each }} {% endfor %}{% endif %} |
{% endfor %}
{% endif %}
{% endfor %}
{% if doc['examples'] is defined %}
#### Examples
```
{% for each in doc['examples'] %}
{{ each | replace('{#','{{') | replace('#}','}}') }}
{% endfor %}
```
{% endif %}
{% for k,v in doc.iteritems() %}
{% if k == 'notes' %}
#### Notes
{% for note in v %}
- {{ note }}
{% endfor %}
{% endif %}
{% endfor %}
---
{% endfor %}
---
Created by Network to Code, LLC
For:
2015