diff --git a/host_vars/orion.archlinux.org b/host_vars/orion.archlinux.org new file mode 100644 index 0000000000000000000000000000000000000000..c5fc70ceb8075aa96364a7fe24058ba9fc21e645 --- /dev/null +++ b/host_vars/orion.archlinux.org @@ -0,0 +1,6 @@ +--- +ipv4_address: "88.198.91.70" +ipv6_address: "2a01:4f8:160:6087::1/128" +ipv4_gateway: "88.198.91.65" +ipv6_gateway: "fe80::1" +filesystem: btrfs diff --git a/playbooks/orion-provision.yml b/playbooks/orion-provision.yml index 1a97b95fc84539630ade708819b58c2e0683e54b..9137d823cbd714609e5118f52b4ce8f49a8c84b8 100644 --- a/playbooks/orion-provision.yml +++ b/playbooks/orion-provision.yml @@ -8,10 +8,5 @@ remote_user: root vars: - hostname: orion - ipv4_address: "88.198.91.70" - ipv6_address: "2a01:4f8:160:6087::1/128" - ipv4_gateway: "88.198.91.65" - ipv6_gateway: "fe80::1" - filesystem: btrfs roles: - install_arch diff --git a/roles/common/handlers/main.yml b/roles/common/handlers/main.yml new file mode 100644 index 0000000000000000000000000000000000000000..19aee0c90bbf64005d14e5466cfc27b407657836 --- /dev/null +++ b/roles/common/handlers/main.yml @@ -0,0 +1,5 @@ +--- + +- name: restart networkd + service: name=systemd-networkd state=restarted + diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml index a512fa8e3b0bad16ac2eb5aee192334eda00c93d..64d33225fadd98a795b5acd57be14a8fcf9cf734 100644 --- a/roles/common/tasks/main.yml +++ b/roles/common/tasks/main.yml @@ -32,3 +32,8 @@ - name: generate ssh key for root command: ssh-keygen -b 4096 -N "" -f /root/.ssh/id_rsa creates="/root/.ssh/id_rsa" + +- name: configure network + template: src=10-static-ethernet.network.j2 dest=/etc/systemd/network/10-static-ethernet.network owner=root group=root mode=0644 + notify: + - restart networkd diff --git a/roles/common/templates/10-static-ethernet.network.j2 b/roles/common/templates/10-static-ethernet.network.j2 new file mode 100644 index 0000000000000000000000000000000000000000..e36edaa350dd23549c477d6ee4883485c180d9bd --- /dev/null +++ b/roles/common/templates/10-static-ethernet.network.j2 @@ -0,0 +1,11 @@ +[Match] +Name=e* + +[Network] +DNS=213.133.98.98 +DNS=213.133.99.99 +DNS=213.133.100.100 +Address={{ ipv4_address }} +Address={{ ipv6_address }} +Gateway={{ ipv4_gateway }} +Gateway={{ ipv6_gateway }} diff --git a/roles/install_arch/templates/10-static-ethernet.network.j2 b/roles/install_arch/templates/10-static-ethernet.network.j2 deleted file mode 100644 index e36edaa350dd23549c477d6ee4883485c180d9bd..0000000000000000000000000000000000000000 --- a/roles/install_arch/templates/10-static-ethernet.network.j2 +++ /dev/null @@ -1,11 +0,0 @@ -[Match] -Name=e* - -[Network] -DNS=213.133.98.98 -DNS=213.133.99.99 -DNS=213.133.100.100 -Address={{ ipv4_address }} -Address={{ ipv6_address }} -Gateway={{ ipv4_gateway }} -Gateway={{ ipv6_gateway }} diff --git a/roles/install_arch/templates/10-static-ethernet.network.j2 b/roles/install_arch/templates/10-static-ethernet.network.j2 new file mode 120000 index 0000000000000000000000000000000000000000..d73e3a3b2dfe323519561a0ac57de85658c9b6de --- /dev/null +++ b/roles/install_arch/templates/10-static-ethernet.network.j2 @@ -0,0 +1 @@ +../../common/templates/10-static-ethernet.network.j2 \ No newline at end of file