Configure eth1 and set hostname

This commit is contained in:
Marco Nenciarini 2022-02-05 18:59:14 +01:00
parent 7bbd42d1e6
commit 63eb166eb9
No known key found for this signature in database
GPG Key ID: 589F03F01BA55038
3 changed files with 18 additions and 1 deletions

View File

@ -13,7 +13,7 @@ locals {
microOS_install_commands = [ microOS_install_commands = [
"set -ex", "set -ex",
"apt install -y aria2", "apt-get install -y aria2",
"aria2c --follow-metalink=mem https://download.opensuse.org/tumbleweed/appliances/openSUSE-MicroOS.x86_64-k3s-kvm-and-xen.qcow2.meta4", "aria2c --follow-metalink=mem https://download.opensuse.org/tumbleweed/appliances/openSUSE-MicroOS.x86_64-k3s-kvm-and-xen.qcow2.meta4",
"qemu-img convert -p -f qcow2 -O host_device $(ls -a | grep -ie '^opensuse.*microos.*k3s.*qcow2$') /dev/sda", "qemu-img convert -p -f qcow2 -O host_device $(ls -a | grep -ie '^opensuse.*microos.*k3s.*qcow2$') /dev/sda",
"sgdisk -e /dev/sda", "sgdisk -e /dev/sda",

View File

@ -33,6 +33,7 @@ resource "hcloud_server" "first_control_plane" {
provisioner "file" { provisioner "file" {
content = templatefile("${path.module}/templates/config.ign.tpl", { content = templatefile("${path.module}/templates/config.ign.tpl", {
name = self.name
ssh_public_key = local.ssh_public_key ssh_public_key = local.ssh_public_key
}) })
destination = "/root/config.ign" destination = "/root/config.ign"

View File

@ -11,5 +11,21 @@
] ]
} }
] ]
},
"storage": {
"files": [
{
"path": "/etc/hostname",
"mode": 420,
"overwrite": true,
"contents": { "source": "data:,${name}" }
},
{
"path": "/etc/sysconfig/network/ifcfg-eth1",
"mode": 420,
"overwrite": true,
"contents": { "source": "data:,BOOTPROTO%3D%27dhcp%27%0ASTARTMODE%3D%27auto%27" }
}
]
} }
} }