diff --git a/terraform/main.tf b/terraform/main.tf index 5fb5315..76a8053 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -14,15 +14,20 @@ terraform { # https://libvirt.org/uri.html#libssh-and-libssh2-transport provider "libvirt" { - # alias = "jefke" + alias = "jefke" uri = "qemu+ssh://root@jefke.hyp/system?known_hosts=/etc/ssh/ssh_known_hosts" } +provider "libvirt" { + alias = "atlas" + uri = "qemu+ssh://root@atlas.hyp/system?known_hosts=/etc/ssh/ssh_known_hosts" +} + module "setup_jefke" { source = "./modules/setup" - # providers = { - # libvirt = libvirt.jefke - # } + providers = { + libvirt = libvirt.jefke + } } module "bancomart" { @@ -30,7 +35,25 @@ module "bancomart" { name = "bancomart" ram = 4096 storage = 25 - # providers = { - # libvirt = libvirt.jefke - # } + providers = { + libvirt = libvirt.jefke + } +} + +module "setup_atlas" { + source = "./modules/setup" + providers = { + libvirt = libvirt.atlas + } +} + +module "maestro" { + source = "./modules/debian" + name = "maestro" + ram = 8192 + storage = 35 + mac = "CA:FE:C0:FF:EE:08" + providers = { + libvirt = libvirt.atlas + } } diff --git a/terraform/modules/debian/files/cloud_init.cfg.tftpl b/terraform/modules/debian/files/cloud_init.cfg.tftpl index 070e8fa..1df897e 100644 --- a/terraform/modules/debian/files/cloud_init.cfg.tftpl +++ b/terraform/modules/debian/files/cloud_init.cfg.tftpl @@ -3,6 +3,12 @@ hostname: "${hostname}" manage_etc_hosts: true disable_root: false +chpasswd: + list: | + root:root + expire: False +ssh_pwauth: true + ssh_authorized_keys: - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOodpLr+FDRyKyHjucHizNLVFHZ5AQmE9GmxMnOsSoaw pimkunis@thinkpadpim" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINUZp4BCxf7uLa1QWonx/Crf8tYZ5MKIZ+EuaBa82LrV user@user-laptop" diff --git a/terraform/modules/debian/main.tf b/terraform/modules/debian/main.tf index d9574a5..5616dc6 100644 --- a/terraform/modules/debian/main.tf +++ b/terraform/modules/debian/main.tf @@ -42,6 +42,7 @@ resource "libvirt_domain" "main" { network_interface { bridge = "bridgedmz" hostname = var.name + mac = var.mac } cloudinit = libvirt_cloudinit_disk.main.id diff --git a/terraform/modules/debian/variables.tf b/terraform/modules/debian/variables.tf index 5d25fb4..ae92434 100644 --- a/terraform/modules/debian/variables.tf +++ b/terraform/modules/debian/variables.tf @@ -11,3 +11,9 @@ variable "storage" { type = number description = "In GiB" } + +variable "mac" { + type = string + description = "MAC address" + default = null +}