Skip to content

Commit 9fc05ca

Browse files
authored
Merge pull request #9 from rasschaert/master
fix jinja templating of config so it renders valid yaml
2 parents e645fad + a4499c5 commit 9fc05ca

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

templates/config.yaml.j2

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# {{ ansible_managed }}
12
pki:
23
# The CAs that are accepted by this node. Must contain one or more certificates created by 'nebula-cert ca'
34
ca: {{ pki.ca }}
@@ -164,16 +165,20 @@ firewall:
164165
{% for rule in outbound %}
165166
- port: "{{ rule.port }}"
166167
proto: "{{ rule.proto }}"
167-
{% if rule.host is defined %}host: "{{ rule.host }}"
168-
{% elif rule.group is defined %}group: "{{ rule.group }}"
169-
{% elif rule.groups is defined %}groups:
170-
{% for group in rule.groups %}
168+
{% if rule.host is defined %}
169+
host: "{{ rule.host }}"
170+
{% elif rule.group is defined %}
171+
group: "{{ rule.group }}"
172+
{% elif rule.groups is defined %}
173+
groups:
174+
{% for group in rule.groups %}
171175
- {{ group }}
172-
{% endfor %}
173-
{% elif rule.cidr is defined %}cidr: {{ rule.cidr }}
174-
{% else %}
176+
{% endfor %}
177+
{% elif rule.cidr is defined %}
178+
cidr: {{ rule.cidr }}
179+
{% else %}
175180
host: any
176-
{% endif %}
181+
{% endif %}
177182
{% endfor %}
178183

179184

@@ -190,7 +195,8 @@ firewall:
190195
{% for group in rule.groups %}
191196
- {{ group }}
192197
{% endfor %}
193-
{% elif rule.cidr is defined %}cidr: {{ rule.cidr }}
198+
{% elif rule.cidr is defined %}
199+
cidr: {{ rule.cidr }}
194200
{% else %}
195201
host: any
196202
{% endif %}

0 commit comments

Comments
 (0)