Configure ethernet interfaces to match those within the VMs
This commit is contained in:
parent
f6888134b8
commit
1bc8974eaf
@ -77,6 +77,7 @@ resource "libvirt_cloudinit_disk" "freeipa_init" {
|
|||||||
pool = libvirt_pool.vm_storage_pool.name
|
pool = libvirt_pool.vm_storage_pool.name
|
||||||
user_data = data.template_file.user_data.rendered
|
user_data = data.template_file.user_data.rendered
|
||||||
network_config = templatefile("${path.module}/templates/network_config.cfg.tpl", {
|
network_config = templatefile("${path.module}/templates/network_config.cfg.tpl", {
|
||||||
|
interface_name = "etho0"
|
||||||
ip_address = "172.30.1.85"
|
ip_address = "172.30.1.85"
|
||||||
gateway_ip = "172.30.1.254"
|
gateway_ip = "172.30.1.254"
|
||||||
dns_ip = "172.30.1.85"
|
dns_ip = "172.30.1.85"
|
||||||
@ -88,6 +89,7 @@ resource "libvirt_cloudinit_disk" "portfolio_init" {
|
|||||||
pool = libvirt_pool.vm_storage_pool.name
|
pool = libvirt_pool.vm_storage_pool.name
|
||||||
user_data = data.template_file.user_data.rendered
|
user_data = data.template_file.user_data.rendered
|
||||||
network_config = templatefile("${path.module}/templates/network_config.cfg.tpl", {
|
network_config = templatefile("${path.module}/templates/network_config.cfg.tpl", {
|
||||||
|
interface_name = "ens3"
|
||||||
ip_address = "172.30.1.93"
|
ip_address = "172.30.1.93"
|
||||||
gateway_ip = "172.30.1.254"
|
gateway_ip = "172.30.1.254"
|
||||||
dns_ip = "172.30.1.85"
|
dns_ip = "172.30.1.85"
|
||||||
@ -99,6 +101,7 @@ resource "libvirt_cloudinit_disk" "minecraft_init" {
|
|||||||
pool = libvirt_pool.vm_storage_pool.name
|
pool = libvirt_pool.vm_storage_pool.name
|
||||||
user_data = data.template_file.user_data.rendered
|
user_data = data.template_file.user_data.rendered
|
||||||
network_config = templatefile("${path.module}/templates/network_config.cfg.tpl", {
|
network_config = templatefile("${path.module}/templates/network_config.cfg.tpl", {
|
||||||
|
interface_name = "ens3"
|
||||||
ip_address = "172.30.1.91"
|
ip_address = "172.30.1.91"
|
||||||
gateway_ip = "172.30.1.254"
|
gateway_ip = "172.30.1.254"
|
||||||
dns_ip = "172.30.1.85"
|
dns_ip = "172.30.1.85"
|
||||||
@ -110,6 +113,7 @@ resource "libvirt_cloudinit_disk" "navidrome_init" {
|
|||||||
pool = libvirt_pool.vm_storage_pool.name
|
pool = libvirt_pool.vm_storage_pool.name
|
||||||
user_data = data.template_file.user_data.rendered
|
user_data = data.template_file.user_data.rendered
|
||||||
network_config = templatefile("${path.module}/templates/network_config.cfg.tpl", {
|
network_config = templatefile("${path.module}/templates/network_config.cfg.tpl", {
|
||||||
|
interface_name = "ens3"
|
||||||
ip_address = "172.30.1.92"
|
ip_address = "172.30.1.92"
|
||||||
gateway_ip = "172.30.1.254"
|
gateway_ip = "172.30.1.254"
|
||||||
dns_ip = "172.30.1.85"
|
dns_ip = "172.30.1.85"
|
||||||
@ -193,7 +197,7 @@ resource "libvirt_domain" "navidrome_vm" {
|
|||||||
cloudinit = libvirt_cloudinit_disk.navidrome_init.id
|
cloudinit = libvirt_cloudinit_disk.navidrome_init.id
|
||||||
network_interface {
|
network_interface {
|
||||||
bridge = "br0"
|
bridge = "br0"
|
||||||
mac = "52:54:00:ef:65"
|
mac = "52:54:00:ee:ef:65"
|
||||||
}
|
}
|
||||||
console {
|
console {
|
||||||
type = "pty"
|
type = "pty"
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#cloud-config
|
#cloud-config
|
||||||
version: 2
|
version: 2
|
||||||
ethernets:
|
ethernets:
|
||||||
eth0:
|
${interface_name}:
|
||||||
dhcp4: no
|
dhcp4: no
|
||||||
addresses:
|
addresses:
|
||||||
- ${ip_address}/24
|
- ${ip_address}/24
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user