Skip to content

Commit 3ddc181

Browse files
authored
fix issue #75 and prep release (#204)
1 parent c93e2b3 commit 3ddc181

File tree

8 files changed

+40
-12
lines changed

8 files changed

+40
-12
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
## UNRELEASED
22

3+
## 0.9.8 (January 17, 2024)
4+
35
NOTES:
46

7+
* Added support for network groups and domain attribute for the `morpheus_vsphere_instance` resource [75](https://github.com/gomorpheus/terraform-provider-morpheus/issues/75).
58
* Added support for managing local user accounts with the addition of the `morpheus_user` resource [187](https://github.com/gomorpheus/terraform-provider-morpheus/issues/187).
69
* Updated resources that include multiline text fields such as catalog items, automation tasks, options lists and more to properly handle heredoc syntax. This change stops resources from continually wanting to apply changes because of a trailing newline character [193](https://github.com/gomorpheus/terraform-provider-morpheus/issues/193).
710
* Added support for managing tenant user roles with the addition of the `morpheus_tenant_role` resource [190](https://github.com/gomorpheus/terraform-provider-morpheus/issues/190).

docs/guides/getting_started.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ terraform {
2525
required_providers {
2626
morpheus = {
2727
source = "gomorpheus/morpheus"
28-
version = "0.9.7"
28+
version = "0.9.8"
2929
}
3030
}
3131
}
@@ -59,9 +59,9 @@ $ terraform init
5959
Initializing the backend...
6060
6161
Initializing provider plugins...
62-
- Finding morpheusdata.com/gomorpheus/morpheus versions matching "0.9.7"...
63-
- Installing morpheusdata.com/gomorpheus/morpheus v0.9.7...
64-
- Installed morpheusdata.com/gomorpheus/morpheus v0.9.7 (unauthenticated)
62+
- Finding morpheusdata.com/gomorpheus/morpheus versions matching "0.9.8"...
63+
- Installing morpheusdata.com/gomorpheus/morpheus v0.9.8...
64+
- Installed morpheusdata.com/gomorpheus/morpheus v0.9.8 (unauthenticated)
6565
6666
Terraform has created a lock file .terraform.lock.hcl to record the provider
6767
selections it made above. Include this file in your version control repository

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ terraform {
2525
required_providers {
2626
morpheus = {
2727
source = "gomorpheus/morpheus"
28-
version = "0.9.7"
28+
version = "0.9.8"
2929
}
3030
}
3131
}

docs/resources/vsphere_instance.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ resource "morpheus_vsphere_instance" "tf_example_vsphere_instance" {
9292
- `create_user` (Boolean) Whether to create a user account on the instance that is associated with the provisioning user account
9393
- `custom_options` (Map of String) Custom options to pass to the instance
9494
- `description` (String) The user friendly description of the instance
95+
- `domain_id` (Number) The ID of the network domain to provision the instance to
9596
- `environment` (String) The environment to assign the instance to
9697
- `evar` (Block List) The environment variables to create (see [below for nested schema](#nestedblock--evar))
9798
- `interfaces` (Block List) The instance network interfaces to create (see [below for nested schema](#nestedblock--interfaces))
@@ -129,6 +130,7 @@ Optional:
129130

130131
- `ip_address` (String)
131132
- `ip_mode` (String)
133+
- `network_group` (Boolean) Whether the network id provided is for a network group or not
132134
- `network_id` (Number) The network to assign the network interface to
133135
- `network_interface_type_id` (Number) The network interface type
134136

examples/guides/getting_started/provider.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ terraform {
22
required_providers {
33
morpheus = {
44
source = "gomorpheus/morpheus"
5-
version = "0.9.7"
5+
version = "0.9.8"
66
}
77
}
88
}

examples/provider/provider.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ terraform {
22
required_providers {
33
morpheus = {
44
source = "gomorpheus/morpheus"
5-
version = "0.9.7"
5+
version = "0.9.8"
66
}
77
}
88
}

morpheus/resource_vsphere_instance.go

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@ func resourceVsphereInstance() *schema.Resource {
7878
Optional: true,
7979
Computed: true,
8080
},
81+
"domain_id": {
82+
Description: "The ID of the network domain to provision the instance to",
83+
Type: schema.TypeInt,
84+
Optional: true,
85+
Computed: true,
86+
ForceNew: true,
87+
},
8188
"environment": {
8289
Description: "The environment to assign the instance to",
8390
Type: schema.TypeString,
@@ -239,6 +246,12 @@ func resourceVsphereInstance() *schema.Resource {
239246
Optional: true,
240247
Computed: true,
241248
},
249+
"network_group": {
250+
Description: "Whether the network id provided is for a network group or not",
251+
Type: schema.TypeBool,
252+
Optional: true,
253+
Computed: true,
254+
},
242255
"ip_address": {
243256
Description: "",
244257
Type: schema.TypeString,
@@ -353,6 +366,9 @@ func resourceVsphereInstanceCreate(ctx context.Context, d *schema.ResourceData,
353366
"code": instanceLayout.Code,
354367
"name": instanceLayout.Name,
355368
},
369+
"networkDomain": map[string]interface{}{
370+
"id": d.Get("domain_id").(int),
371+
},
356372
}
357373

358374
// Description
@@ -539,6 +555,7 @@ func resourceVsphereInstanceRead(ctx context.Context, d *schema.ResourceData, me
539555
d.Set("nested_virtualization", true)
540556
}
541557
d.Set("custom_options", instance.Config["customOptions"])
558+
d.Set("domain_id", instance.NetworkDomain.Id)
542559
return diags
543560
}
544561

@@ -630,8 +647,14 @@ func parseNetworkInterfaces(interfaces []interface{}) []map[string]interface{} {
630647
row := make(map[string]interface{})
631648
item := (interfaces)[i].(map[string]interface{})
632649
if item["network_id"] != nil {
633-
row["network"] = map[string]interface{}{
634-
"id": fmt.Sprintf("network-%d", item["network_id"].(int)),
650+
if item["network_group"].(bool) {
651+
row["network"] = map[string]interface{}{
652+
"id": fmt.Sprintf("networkGroup-%d", item["network_id"].(int)),
653+
}
654+
} else {
655+
row["network"] = map[string]interface{}{
656+
"id": fmt.Sprintf("network-%d", item["network_id"].(int)),
657+
}
635658
}
636659
}
637660
if item["ip_address"] != nil {

templates/guides/getting_started.md.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ $ terraform init
3737
Initializing the backend...
3838

3939
Initializing provider plugins...
40-
- Finding morpheusdata.com/gomorpheus/morpheus versions matching "0.9.7"...
41-
- Installing morpheusdata.com/gomorpheus/morpheus v0.9.7...
42-
- Installed morpheusdata.com/gomorpheus/morpheus v0.9.7 (unauthenticated)
40+
- Finding morpheusdata.com/gomorpheus/morpheus versions matching "0.9.8"...
41+
- Installing morpheusdata.com/gomorpheus/morpheus v0.9.8...
42+
- Installed morpheusdata.com/gomorpheus/morpheus v0.9.8 (unauthenticated)
4343

4444
Terraform has created a lock file .terraform.lock.hcl to record the provider
4545
selections it made above. Include this file in your version control repository

0 commit comments

Comments
 (0)