aboutsummaryrefslogtreecommitdiff
path: root/os
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2020-10-22 20:22:57 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2020-10-22 20:22:57 +0200
commit5902805ac944ef6fe83508947de197678b8a86bd (patch)
treec8776d55ad6151861615331e54b0aa34c9b9f4c2 /os
parente465d65a27f31c1e00b1cf8ebd2d3972d192d99a (diff)
downloadinfrastructure-5902805ac944ef6fe83508947de197678b8a86bd.tar.gz
infrastructure-5902805ac944ef6fe83508947de197678b8a86bd.zip
Reintroduce resolv.conf, it is needed + change DNS from FDN (broken) to Free
Diffstat (limited to 'os')
-rw-r--r--os/config/production.yml9
-rw-r--r--os/config/roles/consul/templates/consul.json.j23
-rw-r--r--os/config/roles/network/tasks/main.yml3
-rw-r--r--os/config/roles/network/templates/en.network2
-rw-r--r--os/config/roles/network/templates/resolv.conf3
5 files changed, 14 insertions, 6 deletions
diff --git a/os/config/production.yml b/os/config/production.yml
index 77624c6..d31193e 100644
--- a/os/config/production.yml
+++ b/os/config/production.yml
@@ -7,7 +7,8 @@ cluster_nodes:
ipv4: 192.168.1.2
ipv6: 2a01:e35:2fdc:dbe0::2
interface: eno1
- dns_server: 80.67.169.40
+ dns_1: 212.27.40.240
+ dns_2: 212.27.40.241
ansible_python_interpreter: python3
silicareux:
@@ -17,7 +18,8 @@ cluster_nodes:
ipv4: 192.168.1.3
ipv6: 2a01:e35:2fdc:dbe0::3
interface: eno1
- dns_server: 80.67.169.40
+ dns_1: 212.27.40.240
+ dns_2: 212.27.40.241
ansible_python_interpreter: python3
wonse:
@@ -27,5 +29,6 @@ cluster_nodes:
ipv4: 192.168.1.4
ipv6: 2a01:e35:2fdc:dbe0::4
interface: eno1
- dns_server: 80.67.169.40
+ dns_1: 212.27.40.240
+ dns_2: 212.27.40.241
ansible_python_interpreter: python3
diff --git a/os/config/roles/consul/templates/consul.json.j2 b/os/config/roles/consul/templates/consul.json.j2
index 76632a6..beea1fa 100644
--- a/os/config/roles/consul/templates/consul.json.j2
+++ b/os/config/roles/consul/templates/consul.json.j2
@@ -18,7 +18,8 @@
"dns": 53
},
"recursors": [
- "{{ dns_server }}"
+ "{{ dns_1 }}",
+ "{{ dns_2 }}"
],
"encrypt": "{{ consul_gossip_encrypt }}",
"domain": "2.cluster.deuxfleurs.fr",
diff --git a/os/config/roles/network/tasks/main.yml b/os/config/roles/network/tasks/main.yml
index caa6bff..8b6d92d 100644
--- a/os/config/roles/network/tasks/main.yml
+++ b/os/config/roles/network/tasks/main.yml
@@ -7,6 +7,9 @@
- name: "Deploy systemd-networkd configuration"
template: src=en.network dest=/etc/systemd/network/en.network
+- name: "Deploy resolv.conf (the DNS section in systemd-networkd requires systemd-resolved...)"
+ template: src=resolv.conf dest=/etc/resolv.conf
+
- name: "Activate IP forwarding"
sysctl:
name: net.ipv4.ip_forward
diff --git a/os/config/roles/network/templates/en.network b/os/config/roles/network/templates/en.network
index b9b52e9..5e680da 100644
--- a/os/config/roles/network/templates/en.network
+++ b/os/config/roles/network/templates/en.network
@@ -5,5 +5,3 @@ Name={{ interface }}
Address={{ ipv4 }}/24
Address={{ ipv6 }}/64
Gateway=192.168.1.254
-DNS={{ ipv4 }}
-DNS={{ dns_server }}
diff --git a/os/config/roles/network/templates/resolv.conf b/os/config/roles/network/templates/resolv.conf
new file mode 100644
index 0000000..44c1897
--- /dev/null
+++ b/os/config/roles/network/templates/resolv.conf
@@ -0,0 +1,3 @@
+nameserver {{ ipv4 }}
+nameserver {{ dns_1 }}
+nameserver {{ dns_2 }}