Skip to content

Commit 9b1a1c5

Browse files
author
Ritwick DSouza
committed
[raspbian] Seprated main loop for each config file in template
1 parent 2ac0773 commit 9b1a1c5

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

netjsonconfig/backends/raspbian/templates/raspbian.jinja2

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,10 @@ iface {{ interface.get('ifname') }} inet6 {{ address.get('proto') }}
7979
{% endif %}
8080

8181
{% endfor %}
82-
{% elif i|string() == 'dns_servers' %}
82+
{% endif %}
83+
{% endfor%}
84+
{% for i, j in data.items() %}
85+
{% if i|string() == 'dns_servers' %}
8386
config: /etc/resolv.conf
8487
{% for ip in j %}
8588
nameserver {{ ip }}
@@ -88,7 +91,10 @@ nameserver {{ ip }}
8891
{% for domain in j %}
8992
search {{ domain }}
9093
{% endfor %}
91-
{% elif i|string() == 'wireless' %}
94+
{% endif %}
95+
{% endfor%}
96+
{% for i, j in data.items() %}
97+
{% if i|string() == 'wireless' %}
9298
{% for wireless in j %}
9399
config: /etc/hostapd/hostapd.conf
94100
interface={{ wireless.get('ifname') }}
@@ -111,4 +117,4 @@ wpa_pairwise={{ wireless.get('encryption').get('wpa_pairwise')}}
111117
{% endfor %}
112118
{% else %}
113119
{% endif %}
114-
{% endfor%}
120+
{% endfor %}

0 commit comments

Comments
 (0)