Skip to content

Commit a49330d

Browse files
author
Ritwick DSouza
committed
[raspbian] Fixed single dns_search template rendering
1 parent 9b1a1c5 commit a49330d

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

netjsonconfig/backends/raspbian/templates/raspbian.jinja2

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,15 @@ iface {{ interface.get('ifname') }} inet6 {{ address.get('proto') }}
8181
{% endfor %}
8282
{% endif %}
8383
{% endfor%}
84+
{% set count = [1] %}
8485
{% for i, j in data.items() %}
85-
{% if i|string() == 'dns_servers' %}
86+
{% if i|string() in ['dns_servers', 'dns_search'] %}
87+
{% if count == [1] %}
8688
config: /etc/resolv.conf
89+
{% if count.append(count.pop() + 1) %}{% endif %}
90+
{% endif %}
91+
{% endif %}
92+
{% if i|string() == 'dns_servers' %}
8793
{% for ip in j %}
8894
nameserver {{ ip }}
8995
{% endfor %}

0 commit comments

Comments
 (0)