Skip to content

Commit c3bc145

Browse files
committed
Merge branch 'master' into real-acceptance-test
2 parents 8e569bd + 3e28496 commit c3bc145

28 files changed

+283
-105
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,4 @@ crash.log
4040
terraform-encrypted-des.sh
4141
terraform-encrypted.sh
4242
terraform-plain.sh
43+
.DS_Store

data_source_obmcs_core_instance.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ func resourceCoreInstance() *schema.Resource {
6565
Type: schema.TypeString,
6666
Computed: true,
6767
},
68+
"ipxe_script": {
69+
Type: schema.TypeString,
70+
Computed: true,
71+
},
6872
"metadata": {
6973
Type: schema.TypeMap,
7074
Computed: true,
@@ -144,6 +148,7 @@ func (s *InstanceDatasourceCrud) SetData() {
144148
"display_name": v.DisplayName,
145149
"id": v.ID,
146150
"image": v.ImageID,
151+
"ipxe_script": v.IpxeScript,
147152
"metadata": v.Metadata,
148153
"region": v.Region,
149154
"shape": v.Shape,

data_source_obmcs_core_subnet.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ func resourceCoreSubnets() *schema.Resource {
8080
Type: schema.TypeString,
8181
Computed: true,
8282
},
83+
"prohibit_public_ip_on_vnic": {
84+
Type: schema.TypeBool,
85+
Computed: true,
86+
},
8387
"state": {
8488
Type: schema.TypeString,
8589
Computed: true,
@@ -154,10 +158,11 @@ func (s *SubnetDatasourceCrud) SetData() {
154158
"security_list_ids": v.SecurityListIDs,
155159
"display_name": v.DisplayName,
156160
"id": v.ID,
157-
"state": v.State,
158-
"time_created": v.TimeCreated.String(),
159-
"virtual_router_ip": v.VirtualRouterIP,
160-
"virtual_router_mac": v.VirtualRouterMac,
161+
"prohibit_public_ip_on_vnic": v.ProhibitPublicIpOnVnic,
162+
"state": v.State,
163+
"time_created": v.TimeCreated.String(),
164+
"virtual_router_ip": v.VirtualRouterIP,
165+
"virtual_router_mac": v.VirtualRouterMac,
161166
}
162167
resources = append(resources, res)
163168
}

data_source_obmcs_core_vnic.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ func VnicDatasource() *schema.Resource {
3434
Type: schema.TypeString,
3535
Computed: true,
3636
},
37+
"hostname_label": {
38+
Type: schema.TypeString,
39+
Computed: true,
40+
},
3741
"state": {
3842
Type: schema.TypeString,
3943
Computed: true,
@@ -81,6 +85,7 @@ func (v *VnicDatasourceCrud) SetData() {
8185
v.D.Set("availability_domain", v.Resource.AvailabilityDomain)
8286
v.D.Set("compartment_id", v.Resource.CompartmentID)
8387
v.D.Set("display_name", v.Resource.DisplayName)
88+
v.D.Set("hostname_label", v.Resource.HostnameLabel)
8489
v.D.Set("state", v.Resource.State)
8590
v.D.Set("private_ip_address", v.Resource.PrivateIPAddress)
8691
v.D.Set("public_ip_address", v.Resource.PublicIPAddress)

docs/Writing Terraform configurations for OBMCS.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@ provider "baremetal" {
4141
private_key_path = "${var.private_key_path}"
4242
}
4343
```
44+
45+
To specify a different region, include the region parameter in your provider definition. Not specifying a value will use the default `us-phoenix-1` region.
46+
```
47+
provider "baremetal" {
48+
...
49+
region = "us-ashburn-1"
50+
}
51+
```
52+
4453
## CamelCase
4554
The OBMCS API uses CamelCase in multiple places. Terraform doesn't support CamelCase in configuration files so we've replaced it with underscores. For example -
4655

docs/datasources/core/subnet.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ The following attributes are exported:
3535
* `security_list_ids` - OCIDs for the security lists to use for VNICs in this subnet.
3636
* `display_name` - A user-friendly name. Does not have to be unique, and it's changeable.
3737
* `id` - The subnet's Oracle ID (OCID).
38+
* `prohibit_public_ip_on_vnic` - Whether VNICs within this subnet can have public IP addresses.
3839
* `vcn_id` - The OCID of the VCN the subnet is in.
3940
* `state` - The VCN's current state. [PROVISIONING, AVAILABLE, TERMINATING, TERMINATED]
4041
* `time_created` - The date and time the VCN was created.

docs/datasources/core/vnic.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ The following attributes are exported:
2424
* `availability_domain` - The VNIC's Availability Domain.
2525
* `display_name` - A user-friendly name. Does not have to be unique.
2626
* `id` - The OCID of the VNIC.
27+
* `hostname_label` - The hostname for the VNIC that is created during instance launch. Used for DNS. .
2728
* `state` - The current state of the VNIC. [PROVISIONING, AVAILABLE, TERMINATING, TERMINATED]
2829
* `private_ip_address` - The private IP addresses of the VNIC, which is within the VNIC subnet and is accessible within the VCN.
2930
* `public_ip_address` - The public IP address of the VNIC, which Oracle performs NAT for at the gateway.

docs/examples/compute/single-instance/block.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ resource "baremetal_core_volume" "TFBlock0" {
22
availability_domain = "${lookup(data.baremetal_identity_availability_domains.ADs.availability_domains[var.AD - 1],"name")}"
33
compartment_id = "${var.compartment_ocid}"
44
display_name = "TFBlock0"
5-
size_in_mbs = "${var.2TB}"
5+
size_in_mbs = "${var.256GB}"
66
}
77

88
resource "baremetal_core_volume_attachment" "TFBlock0Attach" {

docs/examples/compute/single-instance/remote-exec.tf

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
resource "null_resource" "remote-exec" {
2-
depends_on = ["baremetal_core_instance.TFInstance"]
2+
depends_on = ["baremetal_core_instance.TFInstance","baremetal_core_volume_attachment.TFBlock0Attach"]
33
provisioner "remote-exec" {
44
connection {
55
agent = false
6-
timeout = "10m"
6+
timeout = "30m"
77
host = "${data.baremetal_core_vnic.InstanceVnic.public_ip_address}"
88
user = "opc"
99
private_key = "${var.ssh_private_key}"
1010
}
1111
inline = [
1212
"touch ~/IMadeAFile.Right.Here",
13+
"sudo iscsiadm -m node -o new -T ${baremetal_core_volume_attachment.TFBlock0Attach.iqn} -p ${baremetal_core_volume_attachment.TFBlock0Attach.ipv4}:${baremetal_core_volume_attachment.TFBlock0Attach.port}",
14+
"sudo iscsiadm -m node -o update -T ${baremetal_core_volume_attachment.TFBlock0Attach.iqn} -n node.startup -v automatic",
15+
"echo sudo iscsiadm -m node -T ${baremetal_core_volume_attachment.TFBlock0Attach.iqn} -p ${baremetal_core_volume_attachment.TFBlock0Attach.ipv4}:${baremetal_core_volume_attachment.TFBlock0Attach.port} -l >> ~/.bashrc"
1316
]
1417
}
1518
}

docs/resources/core/instance.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,6 @@ The following attributes are exported:
4848
* `region` - The region that contains the Availability Domain the instance is running in.
4949
* `shape` - The shape of the instance. The shape determines the number of CPUs and the amount of memory allocated to the instance.
5050
* `time_created` - The date and time the instance was created.
51+
52+
* `public_ip` - The public ip of instance vnic (if enabled).
53+
* `private_ip` - The private ip of instance vnic (if enabled).

0 commit comments

Comments
 (0)