summaryrefslogtreecommitdiff
path: root/templates/resolv.conf.tmpl
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2014-03-05 15:05:59 -0800
committerJoshua Harlow <harlowja@yahoo-inc.com>2014-03-05 15:05:59 -0800
commitcc79c859115ceb520877c0afaece4c28d6031499 (patch)
tree1deb6b7613faa9d150519222556e9a0c5991bf3f /templates/resolv.conf.tmpl
parent3f3450660f5f7118ac0583de5d137120c1ae4abd (diff)
downloadvyos-cloud-init-cc79c859115ceb520877c0afaece4c28d6031499.tar.gz
vyos-cloud-init-cc79c859115ceb520877c0afaece4c28d6031499.zip
Switch to jinja & adjust tpls
Diffstat (limited to 'templates/resolv.conf.tmpl')
-rw-r--r--templates/resolv.conf.tmpl51
1 files changed, 21 insertions, 30 deletions
diff --git a/templates/resolv.conf.tmpl b/templates/resolv.conf.tmpl
index b7e97b13..6f908f30 100644
--- a/templates/resolv.conf.tmpl
+++ b/templates/resolv.conf.tmpl
@@ -1,39 +1,30 @@
-#
+## template:jinja
# Your system has been configured with 'manage-resolv-conf' set to true.
# As a result, cloud-init has written this file with configuration data
# that it has been provided. Cloud-init, by default, will write this file
# a single time (PER_ONCE).
#
+{% if nameservers is defined %}
+{% for server in nameservers %}
+nameserver {{server}}
+{% endfor %}
-#if $varExists('nameservers')
-#for $server in $nameservers
-nameserver $server
-#end for
-#end if
-#if $varExists('searchdomains')
-search #slurp
-#for $search in $searchdomains
-$search #slurp
-#end for
+{% endif -%}
+{% if searchdomains is defined %}
+search {% for search in searchdomains %}{{search}} {% endfor %}
-#end if
-#if $varExists('domain')
-domain $domain
-#end if
-#if $varExists('sortlist')
-sortlist #slurp
-#for $sort in $sortlist
-$sort #slurp
-#end for
+{% endif %}
+{% if domain is defined %}
+domain {{domain}}
+{% endif %}
+{% if sortlist is defined %}
-#end if
-#if $varExists('options') or $varExists('flags')
-options #slurp
-#for $flag in $flags
-$flag #slurp
-#end for
-#for $key, $value in $options.items()
-$key:$value #slurp
-#end for
+sortlist {% for sort in sortlist %}{{sort}} {% endfor %}
+{% endif %}
+{% if options is defined or flags is defined %}
-#end if
+options {% for flag in flags %}{{flag}} {% endfor %}
+{% for key, value in options.iteritems() -%}
+ {{key}}:{{value}}
+{% endfor %}
+{% endif %}