Commit 76bef33f authored by nanahira's avatar nanahira

add backup dnses

parent 61a9b346
...@@ -11,16 +11,6 @@ ...@@ -11,16 +11,6 @@
max-size: '1g' max-size: '1g'
# registry-mirrors # registry-mirrors
tasks: tasks:
- name: set resolv.conf
become: true
copy:
content: |
nameserver 127.0.0.1
{% for dns in smartdns.china_dns %}
nameserver {{dns}}
{% endfor %}
dest: /etc/resolv.conf
- name: read docker daemon - name: read docker daemon
become: true become: true
shell: 'cat /etc/docker/daemon.json' shell: 'cat /etc/docker/daemon.json'
......
...@@ -3,6 +3,11 @@ ...@@ -3,6 +3,11 @@
copy: copy:
content: | content: |
nameserver 127.0.0.1 nameserver 127.0.0.1
{% for br in bridges %}
{% if not (br.masq is defined and br.masq) and br.address is defined and br.address %}
nameserver {{ br.address | regex_replace("/\d+$", "") }}
{% endif %}
{% endfor %}
{% for dns in smartdns.china_dns %} {% for dns in smartdns.china_dns %}
nameserver {{dns}} nameserver {{dns}}
{% endfor %} {% endfor %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment