Foreman requires mtu, network type, ipam and boot mode but they was flagged as optional in this module. Changed arguments to required and added autodoc documentation.
terraform apply
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following
symbols:
+ create
Terraform will perform the following actions:
# foreman_subnet.example will be created
+ resource "foreman_subnet" "example" {
+ __meta__ = (known after apply)
+ id = (known after apply)
+ mask = "255.255.255.0"
+ name = "10.228.247.0 BO1"
+ network = "10.228.247.0"
}
Plan: 1 to add, 0 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
foreman_subnet.example: Creating...
╷
│ Error: HTTP Error:{
│ endpoint: [https://192.168.122.244/api/subnets]
│ statusCode: [500]
│ respBody: [{
│ "error": {"message":"ERF42-0624 [Foreman::Exception]: unknown network_type"}
│ }
│ ]
│ }
│
│ with foreman_subnet.example,
│ on main.tf line 26, in resource "foreman_subnet" "example":
│ 26: resource "foreman_subnet" "example" {
│
╵
terraform apply output with added network_type:
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following
symbols:
+ create
Terraform will perform the following actions:
# foreman_subnet.example will be created
+ resource "foreman_subnet" "example" {
+ __meta__ = (known after apply)
+ id = (known after apply)
+ mask = "255.255.255.0"
+ name = "10.228.247.0 BO1"
+ network = "10.228.247.0"
+ network_type = "IPv4"
}
Plan: 1 to add, 0 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
foreman_subnet.example: Creating...
╷
│ Error: HTTP Error:{
│ endpoint: [https://192.168.122.244/api/subnets]
│ statusCode: [422]
│ respBody: [{
│ "error": {"id":null,"errors":{"boot_mode":["is not included in the list"],"ipam":["not supported by this protocol"],"mtu":["must be greater than or equal to 68"]},"full_messages":["Boot mode is not included in the list","Ipam not supported by this protocol","Mtu must be greater than or equal to 68"]}
│ }
│ ]
│ }
│
│ with foreman_subnet.example,
│ on main.tf line 26, in resource "foreman_subnet" "example":
│ 26: resource "foreman_subnet" "example" {
│
╵
Foreman requires mtu, network type, ipam and boot mode but they was flagged as optional in this module. Changed arguments to required and added autodoc documentation.
cat main.tf
Terraform apply output :
terraform apply output with added network_type: