Skip to content

Commit

Permalink
netplan
Browse files Browse the repository at this point in the history
  • Loading branch information
james-otten committed Dec 30, 2024
1 parent 8d26c31 commit 170cb7a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 35 deletions.
31 changes: 15 additions & 16 deletions ansible/roles/chrony_server/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,6 @@
enabled: true
daemon_reload: true

- name: Netplan dummy0 interface
ansible.builtin.template:
src: netplan_dummy0.yaml.j2
dest: /etc/netplan/dummy0.yaml
mode: "600"

- name: Netplan dummy1 interface
ansible.builtin.template:
src: netplan_dummy1.yaml.j2
dest: /etc/netplan/dummy1.yaml
mode: "600"

- name: Iptables rules
ansible.builtin.template:
src: iptables.j2
Expand All @@ -81,10 +69,21 @@
cmd: "bash -c '/sbin/iptables-restore < /etc/iptables/rules.v4'"
creates: /tmp/fake_for_linter

- name: Netplan apply
ansible.builtin.command:
cmd: "bash -c 'netplan apply && touch /tmp/netplan_applied'"
creates: /tmp/netplan_applied
- name: Cleanup old netplan file
ansible.builtin.file:
path: /etc/netplan/dummy0.yaml
state: "absent"

- name: Cleanup old netplan file
ansible.builtin.file:
path: /etc/netplan/dummy1.yaml
state: "absent"

- name: Import the netplan_loopback role from the nycmesh.common collection
ansible.builtin.import_role:
name: nycmesh.common.netplan_loopback
vars:
netplan_loopback_ips: "{{ NTP_IP }};{{ ROUTER_ID }}"

- name: Restart and enable iptables service
ansible.builtin.service:
Expand Down
9 changes: 0 additions & 9 deletions ansible/roles/chrony_server/templates/netplan_dummy0.yaml.j2

This file was deleted.

9 changes: 0 additions & 9 deletions ansible/roles/chrony_server/templates/netplan_dummy1.yaml.j2

This file was deleted.

2 changes: 1 addition & 1 deletion ansible/roles/requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ collections:
- name: nycmesh.common
source: git+https://github.com/nycmeshnet/nycmesh-ansible.git
type: git
version: main
version: james/netplan_loopback_ip

0 comments on commit 170cb7a

Please sign in to comment.