Commit 53dd4d68 authored by Florian Pritz's avatar Florian Pritz
Browse files

Configure network/dns on PIA machines



Signed-off-by: Florian Pritz's avatarFlorian Pritz <bluewind@xinu.at>
parent ce5d2377
---
configure_network: true
dns_servers:
- 213.133.98.98
- 213.133.99.99
- 213.133.100.100
---
configure_network: false
configure_network: true
dns_servers:
- 8.8.8.8
- 8.8.4.4
......@@ -2,3 +2,8 @@
mirror_domain: ind.mirror.pkgbuild.com
archweb_mirrorcheck_locations: [10]
arch32_mirror_domain: ind.mirror.archlinux32.org
network_interface: "eno2"
ipv4_address: "169.38.85.99"
ipv4_netmask: "/26"
ipv4_gateway: "169.38.85.65"
dns_servers: ["127.0.0.1"]
......@@ -8,6 +8,7 @@
- { role: sshd }
- { role: root_ssh }
- { role: nginx }
- { role: unbound }
- { role: syncrepo, tags: ['nginx'] }
- { role: archweb, archweb_site: false, archweb_services: false, archweb_mirrorcheck: true }
- { role: zabbix-agent, tags: ["zabbix"] }
......
---
configure_network: false
network_interface: "e*"
......@@ -38,6 +38,18 @@
- restart networkd
when: configure_network
- name: create symlink to resolv.conf
file: src=/run/systemd/resolve/resolv.conf dest=/etc/resolv.conf state=link force=yes
when: configure_network
- name: start networkd
service: name=systemd-networkd state=started enabled=yes
when: configure_network
- name: start resolved
service: name=systemd-resolved state=started enabled=yes
when: configure_network
- name: configure default qdisc
sysctl:
name: net.core.default_qdisc
......
[Match]
Name=e*
Name={{network_interface}}
[Network]
DNS=213.133.98.98
DNS=213.133.99.99
DNS=213.133.100.100
{% for server in dns_servers %}
DNS={{server}}
{% endfor %}
Gateway={{ ipv4_gateway }}
{% if ipv6_gateway is defined %}
Gateway={{ ipv6_gateway }}
{% endif %}
Domains=archlinux.org.
[Address]
Address={{ ipv4_address }}{{ ipv4_netmask }}
Peer={{ ipv4_gateway }}{{ ipv4_netmask }}
{% if ipv4_netmask == "/32" %}
Peer={{ ipv4_gateway }}{{ ipv4_netmask}}
{% endif %}
{% if ipv6_address is defined %}
[Address]
Address={{ ipv6_address }}{{ ipv6_netmask }}
{% endif %}
Supports Markdown
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