Skip to content

Commit

Permalink
Restore initial netplan config
Browse files Browse the repository at this point in the history
  • Loading branch information
jbemmel committed Dec 8, 2024
1 parent 1c6134c commit 6bbaf71
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions netsim/ansible/templates/initial/linux/debian.j2
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
echo -n 'Starting initial config ' && date

# Set persistent hostname
hostnamectl set-hostname {{ inventory_hostname }}

# Update APT and install netplan
apt-get update -qq
apt-get install -qq nplan

# (Overwrite resolved config to remove DNS stuff)
cat <<SCRIPT >/etc/netplan/01-netcfg.yaml
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: true
dhcp6: false
optional: true
SCRIPT
netplan apply
# cat <<SCRIPT > /etc/systemd/resolved.conf
# [Resolve]
# DNS=
Expand All @@ -12,13 +31,6 @@ echo -n 'Starting initial config ' && date
# SCRIPT
# systemctl restart systemd-resolved
# Set persistent hostname
hostnamectl set-hostname {{ inventory_hostname }}
# Update APT and install netplan
apt-get update -qq
apt-get install -qq nplan
{% if netlab_net_tools|default(False) %}
#
# Install net-tools (arp, route...)
Expand Down Expand Up @@ -72,7 +84,7 @@ net.ipv6.conf.{{ l.ifname }}.disable_ipv6=0
SCRIPT
sysctl -p /etc/sysctl.d/10-netsim.conf
# Loopback addressing, JvB commented out
# Loopback addressing
{% if loopback.ipv4 is defined or loopback.ipv6 is defined %}
cat <<SCRIPT > /etc/netplan/02-loopback.yaml
network:
Expand Down

0 comments on commit 6bbaf71

Please sign in to comment.