Skip to content

Commit

Permalink
fix dns servers
Browse files Browse the repository at this point in the history
  • Loading branch information
git@itrichter.de committed Mar 20, 2022
1 parent 4af781b commit 9791e18
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions roles/prereq/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dns_servers: []
7 changes: 7 additions & 0 deletions roles/prereq/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@
state: present
reload: true

- name: fix dns servers in resolv.conf
template:
src: resolv.conf.j2
dest: /etc/resolv.conf
when:
- dns_servers | length() > 0

- name: Add br_netfilter to /etc/modules-load.d/
copy:
content: "br_netfilter"
Expand Down
3 changes: 3 additions & 0 deletions roles/prereq/templates/resolv.conf.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% for dns_server in dns_servers %}
nameserver {{ dns_server }}
{% endfor %}

0 comments on commit 9791e18

Please sign in to comment.