@olivierlambert Thanks, just stumbled over this a few minutes ago and tried it, but doesn't work. According to https://www.digitalocean.com/community/tutorials/an-introduction-to-cloud-config-scripting#write-files-to-the-disk
This currently only works for RHEL-based distributions.
But this led me to write_files
and this works:
write_files:
- path: /etc/resolv.conf
content: |
domain exmple.com
search example.com
nameserver 192.168.20.1
this is the full configuration I use:
#cloud-config
hostname: {name}
timezone: Europe/Vienna
users:
- default
- name: johndow
passwd: ****
sudo: ALL=(ALL) NOPASSWD:ALL
groups: users, admin, sudo
shell: /bin/bash
lock_passwd: true
ssh_authorized_keys:
- ssh-ed25519 AAAA****
write_files:
- path: /etc/resolv.conf
content: |
domain example.com
search example.com
nameserver 192.168.20.1
package_update: true
packages:
- sudo
- htop
- vim
- python
- tmux
package_upgrade: true
runcmd:
- sudo reboot
the Network configuration looks like this:
version: 2
ethernets:
eth0:
match:
name: eth0
addresses:
- 192.168.20.6/28
gateway4: 192.168.20.1
eth1:
match:
name: eth1
addresses:
- 10.10.10.6/24
but now it seems I forgot the MTU but this is a different story, thanks for the hint in the right direction.