diff --git a/roles/netplan-static-ip/defaults/main.yml b/roles/netplan-static-ip/defaults/main.yml deleted file mode 100644 index c8edb03..0000000 --- a/roles/netplan-static-ip/defaults/main.yml +++ /dev/null @@ -1,5 +0,0 @@ -# vim:ft=ansible: -netplan_gateway: 192.168.1.1 -# Note: this is a string representing a YAML array -# NOT a YAML array -netplan_addresses: "[ 192.168.103.100, 192.168.103.101 ]" diff --git a/roles/netplan-static-ip/tasks/main.yml b/roles/netplan-static-ip/tasks/main.yml deleted file mode 100644 index 3fdb431..0000000 --- a/roles/netplan-static-ip/tasks/main.yml +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env ansible-playbook -# vim:ft=ansible: ---- -- name: disable cloud-init networking - copy: - dest: /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg - content: 'network: {config: disabled}' - # We don't apply network config after doing this because it doesn't actually - # matter. The next config comes after it and overrides it anyway. - # I just do this to make things cleaner. -- name: remove 50-cloud-init.yaml - file: path=/etc/netplan/50-cloud-init.yaml state=absent -- name: configure netplan static ip - copy: - dest: /etc/netplan/51-static-ip.yaml - # Note: some syntax highlighters will say the stanza below is yaml - # It's not. It's a heredoc - content: | - network: - ethernets: - eth0: - dhcp4: no - addresses: - - {{ static_ip }} - gateway4: {{ netplan_gateway }} - nameservers: - addresses: {{ netplan_addresses }} - register: netplan -- name: apply netplan - command: netplan apply - when: netplan is changed