From c812dd514daeae0802b9a2fea95f62a52ff7d720 Mon Sep 17 00:00:00 2001 From: Jacob Babor Date: Tue, 23 Apr 2024 18:03:22 -0500 Subject: [PATCH] Remove netplan-static-ip role --- roles/netplan-static-ip/defaults/main.yml | 5 ---- roles/netplan-static-ip/tasks/main.yml | 31 ----------------------- 2 files changed, 36 deletions(-) delete mode 100644 roles/netplan-static-ip/defaults/main.yml delete mode 100644 roles/netplan-static-ip/tasks/main.yml 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