-
Notifications
You must be signed in to change notification settings - Fork 79
/
template.adoc.jinja
150 lines (126 loc) · 4.09 KB
/
template.adoc.jinja
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
{%- macro resource_location(resource) -%}
{%- if resource.path -%}
{%- if resource.path.startswith("/") or resource.path.startswith("./") or resource.path.startswith("../") -%}
{{resource.path}}
{%- else -%}
./{{resource.path}}
{%- endif -%}
{%- elif resource.url -%}
{{resource.url}}
{%- elif resource.git -%}
{%- if repository.git.url.endswith(".git") -%}
{{repository.git.url[0:-4]}}
{%- else -%}
{{repository.git.url}}
{%- endif -%}
{%- if repository.git.ref -%}
/tree/{{repository.git.ref}}
{%- endif -%}
{%- endif -%}
{%- endmacro %}
{%- macro resource_name(resource) -%}
{%- if resource.name -%}
{{resource.name}}
{%- else -%}
{{resource_location(resource).split("/")[-1]}}
{%- endif -%}
{%- endmacro %}
{%- macro relative_module(target) -%}
{%- for comp in name.split(".") -%}
../
{%- endfor -%}
{{target.replace(".","/")}}
{%- endmacro %}
= link:./module.yaml[{{name}}]
:toc:
:toc-placement!:
:toclevels: 5
{{description}}
toc::[]
== Labels
{% if labels %}
The following labels will be defined on the image:
{%- for label in labels|sort(attribute="name") %}
{{label.name}}:: {{label.value}}
{%- endfor -%}
{%- else -%}
No labels defined.
{% endif %}
== Environment Variables
The following environment variables are used to configure the functionality provided by this module:
|=======================================================================
|Name |Description |Example
{%- if envs -%}
{%- for env in envs|sort(attribute="name") -%}
{%- if env.description or env.example %}
|{{env.name}} |{{env.description}} |{{env.example}}
{%- endif -%}
{%- endfor -%}
{%- endif %}
|=======================================================================
The following environment variables will be configured on the image:
|=======================================================================
|Name |Value
{%- if envs -%}
{%- for env in envs|sort(attribute="name") -%}
{%- if env.value %}
|{{env.name}} |{{env.value}}
{%- endif -%}
{%- endfor -%}
{%- endif %}
|=======================================================================
== Resources
{% if artifacts %}
The following resources will be included through this module:
|=======================================================================
|Name |Location |Checksum
{%- for artifact in artifacts|sort(attribute="name") %}
|{{resource_name(artifact)}}
|{{resource_location(artifact)}}
a|
md5:: {{artifact.md5}}
sha1:: {{artifact.sha1}}
sha256:: {{artifact.sha256}}
{%- endfor %}
|=======================================================================
{%- else -%}
No additional resources will be installed through this module.
{%- endif %}
== RPM Packages
=== Installed RPM Packages
{% if packages and packages.install %}
The following RPMs will be installed by this module:
{% for package in packages.install|sort %}
* {{package}}
{%- endfor -%}
{%- else -%}
No RPMs will be installed by this module.
{%- endif %}
=== RPM Package Repositories
{% if packages and packages.repositories %}
Installed RPMs will be sourced from the following package repositories:
{% for repository in packages.repositories|sort %}
* {{repository}}
{%- endfor -%}
{%- else -%}
No additional RPM package repositories are required to install listed RPMs.
{%- endif %}
== Modules
=== Included Modules
{% if modules and modules.install %}
The following modules will be installed with this module:
{%- for module in modules.install|sort(attribute="name") %}
link:{{relative_module(module.name)}}/README.adoc[{{module.name}}{% if module.version %}:{{module.version}}{% endif %}]
{%- endfor -%}
{%- else -%}
No additional modules will be installed through this module.
{%- endif %}
=== Module Repositories
{% if modules and modules.repositories %}
The following module repositories will be used to locate other modules.
{%- for repository in modules.repositories|sort(attribute="name") %}
{{resource_name(repository)}}:: {{resource_location(repository)}}
{%- endfor -%}
{%- else -%}
No module repositories defined.
{%- endif %}