-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fails to create a vlan and a subnet in a single plan with DHCP_ON #53
Comments
Let's figure out if we can express the dependencies properly so that we first create the VLAN without DHCP, then create a subnet with IP ranges, then finally go back and turn on DHCP for the VLAN. |
I was thinking a solution that involves the development of a new resource named e.g. In the below snippet I have included a demonstration of the new resource. NOTES:
Opinions? data "maas_vlan" "vlan" {
fabric = "fabric-0"
vid = 100
}
data "maas_vlan" "relay_vlan" {
fabric = "fabric-0"
vid = 0
}
data "maas_rack_controller" "controller_primary" {
name = "maas-dev-1"
}
data "maas_rack_controller" "controller_secondary" {
name = "maas-dev-2"
}
resource "maas_subnet" "subnet_1" {
fabric = data.maas_fabric.fabric.id
vlan = data.maas_vlan.id
name = "test_subnet"
cidr = "10.77.77.0/24"
gateway_ip = "10.77.77.1"
dns_servers = [
"1.1.1.1",
]
}
resource "maas_subnet_ip_range" "dynamic_ip_range_1_1" {
subnet = maas_subnet.subnet_1.id
type = "dynamic"
start_ip = "10.77.77.2"
end_ip = "10.77.77.60"
}
resource "maas_subnet_ip_range" "dynamic_ip_range_1_2" {
subnet = maas_subnet.subnet_1.id
type = "dynamic"
start_ip = "10.77.77.61"
end_ip = "10.77.77.120"
}
resource "maas_vlan_dhcp" "dhcp" {
vlan = data.maas_vlan.id
ip_ranges = [
maas_subnet_ip_range.dynamic_ip_range_1_1,
maas_subnet_ip_range.dynamic_ip_range_1_2,
]
// Optional additional field
// subnets = [
// maas_subnet.subnet_1.id,
// ]
// Optional
relay_vlan = data.maas_vlan.relay_vlan.id
// XOR
primary_rack_controller = data.maas_rack_controller.controller_primary.id
secondary_rack_controller = data.maas_rack_controller.controller_secondary.id
} |
IIUC users will have to pick one of:
I am wondering how it will be possible to "enable/disable DHCP on certain VLAN" in this case?
I like the idea with |
Not exactly that, but close to that. With the proposed solution, DHCP of a VLAN is decoupled of its lifecycle. So The existence of this new resource will mean DHCP is enabled to the VLAN, linked by id. To achieve that, user has to additionally define the primary rack controller which will serve the DHCP. A secondary rack controller can be to defined with the relevant optional field. In case user wants to enable DHCP by relay VLAN, instead of providing a primary rack (+ optional secondary), they have to set the The deletion of a |
We are also impacted by this feature request. We're using this Terraform provider to manage our reasonably large maas deployment of about 1500 vlans and about 1000 machines per site and would greatly benefit from being able to define a This would save us a lot of toil and keep all MAAS configuration defined inside our Terraform repo instead of in ancillary scripts. With no understanding of the project and feature timeline, I am wondering if there is a process and/or potential for us to contribute to this feature via PR ? |
Terraform Version
Affected Resource(s)
Please list the resources as a list, for example:
Terraform Configuration Files
Expected Behavior
Terraform's apply succeeds on the first run.
Actual Behavior
The plan fails with the following error:
If I set
dchp_on = false
, on the first apply, then totrue
on the second, it works.Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform apply
The text was updated successfully, but these errors were encountered: