Skip to content
Snippets Groups Projects
Commit 597f35bf authored by Rafael László's avatar Rafael László :speech_balloon:
Browse files

Add netplan config and traceroute package

parent c50bb4a9
No related branches found
No related tags found
No related merge requests found
......@@ -23,3 +23,19 @@ users:
# passwordless_sudo: yes
# # https://docs.ansible.com/ansible/latest/collections/ansible/posix/authorized_key_module.html#examples
# keys_url: https://git.sch.bme.hu/xy.keys
# netplan:
# network:
# ethernets:
# ens192:
# dhcp4: no
# addresses:
# - 152.66.208.666/24
# nameservers:
# search: [sch.bme.hu]
# addresses: [152.66.208.1, 8.8.8.8]
# gateway4: 152.66.208.254
# ens224:
# dhcp4: no
# addresses:
# - 192.168.1.254/24
......@@ -34,3 +34,7 @@
- name: Fix multipath UUID VMWare errors
include_tasks: multipath.yaml
- name: Update netplan config
include_tasks: netplan.yaml
when: netplan is defined
---
- name: Disable cloud init networking
template:
src: etc/cloud/cloud.cfg.d/99-disable-network-config.cfg.j2
dest: /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
mode: 0644
- name: Add netplan network config
template:
src: etc/netplan/01-netcfg.yaml.j2
dest: /etc/netplan/01-netcfg.yaml
mode: 0644
register: netplan_config
- name: Remove old netplan config
ansible.builtin.file:
path: /etc/netplan/50-cloud-init.yaml
state: absent
when: netplan_config.changed
- name: Apply Netplan Configuration
command: netplan apply
when: netplan_config.changed
......@@ -19,6 +19,7 @@
- strace
- tcpdump
- xxd
- traceroute
# Editors
- nano
......
#
# !!!
# {{ ansible_managed }}
# !!!
# Disable cloudinit network config
network: {config: disabled}
#
# !!!
# {{ ansible_managed }}
# !!!
network:
version: 2
renderer: networkd
ethernets:
{{ netplan['network']['ethernets']|to_nice_yaml|indent(4, true) }}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment