I'd like if there was a intermediate resource between machine and instance so a user can configure parameters unrelated to power parameters, such as domain, hostname, pool, etc, as well as configuring network interfaces that cannot otherwise be allocated using the maas_instance resource.
For example,
// Find a few machines and allocate them, set them to appropriate resource pools
resource "maas_allocation" "example" {
count = 3
// Parameters used for finding machines to allocate.
// Machines found are changed to be "allocated" https://maas.io/docs/how-to-allocate-machines-with-maas
system_id = maas_machine.example[count.index].system_id // Or leave null
min_memory = 12345
min_cpu_count = 12
tags = [...]
zone = "some_AZ"
// Parameters that change the machine parameters
hostname = "my_new_hostname"
domain = "a non-default domain"
pool = "a non-default pool"
mark = true // New: Mark machine as "Allocated" in MAAS
}
// Create a few VLAN interfaces, as these cannot be created after a machine has been deployed
resource "maas_network_interface_vlan" "example" {
count = length(maas_allocation.example)
depends_on = [maas_allocation.example]
fabric = "fabric-1"
machine = maas_llocation.example[count.index].system_id // or fqdn, or hostname
parent = "ens1"
vlan = 123
}
// Or block devices...
resource "maas_block_device" "example" {
count = length(maas_allocation.example)
depends_on = [maas_allocation.example]
machine = maas_llocation.example[count.index].system_id // or fqdn, or hostname
...
}
// Deploy the allocated machines
resource "maas_instance" "example" {
count = length(maas_allocation.example)
depends_on = [maas_allocation.example, maas_network_interface_vlan.example, maas_block_device.example]
allocate_params {
// Machines marked as "Allocated" should only be able to be deployed by specifying the
// host or system_id
hostname = maas_allocation.example[count.index].hostname
system_id = maas_allocation.example[count.index].system_id // Known from the previous allocation.
}
}
I'd like if there was a intermediate resource between
machine
andinstance
so a user can configure parameters unrelated to power parameters, such asdomain
,hostname
,pool
, etc, as well as configuring network interfaces that cannot otherwise be allocated using themaas_instance
resource.For example,