Remove netplan-static-ip role
This commit is contained in:
parent
9ac28a281b
commit
c812dd514d
@ -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 ]"
|
@ -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
|
Loading…
Reference in New Issue
Block a user