canonical / terraform-provider-maas

Terraform MAAS provider
Mozilla Public License 2.0
60 stars 43 forks source link

Ability to set VLAN's primary controller for dhcp #55

Open rmammadli opened 1 year ago

rmammadli commented 1 year ago

Hi, We are facing an issue during dhcp turning on for certain vlan.

main.tf

...
resource "maas_vlan" "vlan" {
  fabric = maas_fabric.fabric.id
  vid    = 20
  dhcp_on = true
  name   = "tf-vlan20"
  space  = maas_space.space.name
}

Terraform execution terraform apply

Error message

│ Error: ServerError: 400 Bad Request ({"__all__": ["dhcp can only be turned on when a primary rack controller is set."]})
│
│   with maas_vlan.vlan["tf-vlan20"],
│   on main.tf line 12, in resource "maas_vlan" "vlan":
│   12: resource "maas_vlan" "vlan" {

Expected result dhcp for vlan is turned on

Note dhcp can be easily enabled in UI for this vlan manually.

Feature request Would it be possible to add an option in resource 'maas_vlan' to define:

ednxzu commented 5 months ago

This is still an issue in the latest provider version. Are there any plans regarding this ?

sempervictus commented 2 months ago

DHCP relay would be really nice to have via TF API

VariableDeclared commented 1 month ago

is there a workaround for this?

rvalle commented 1 month ago

Experiencing this problem too, it is not possible to setup dhcp_on, using terraform, because it requires the rack controller.