Merge pull request #40 from mnencia/staging

Configure eth1 and set hostname
This commit is contained in:
Karim Naufal 2022-02-05 23:01:11 +01:00 committed by GitHub
commit 4eaebce270
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 1 deletions

View File

@ -13,7 +13,7 @@ locals {
microOS_install_commands = [
"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",
"qemu-img convert -p -f qcow2 -O host_device $(ls -a | grep -ie '^opensuse.*microos.*k3s.*qcow2$') /dev/sda",
"sgdisk -e /dev/sda",

View File

@ -33,6 +33,7 @@ resource "hcloud_server" "first_control_plane" {
provisioner "file" {
content = templatefile("${path.module}/templates/config.ign.tpl", {
name = self.name
ssh_public_key = local.ssh_public_key
})
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" }
}
]
}
}