Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bo-Chun Chen
Terraform Openstack
Commits
41c1730d
Commit
41c1730d
authored
Jun 27, 2019
by
Ryan Randles Jones
Browse files
Update main.tf
parent
4d1e4d09
Changes
1
Hide whitespace changes
Inline
Side-by-side
main.tf
View file @
41c1730d
# creates public and private keypair
resource
"openstack_compute_keypair_v2"
"test-keypair"
{
name
=
"my-keypair"
}
# defines where floating ip will come from using variable from vars.tf
resource
"openstack_networking_floatingip_v2"
"ohpc"
{
...
...
@@ -10,7 +14,7 @@ resource "openstack_compute_instance_v2" "ohpc" {
name
=
"ohpc"
image_name
=
"
${
var
.
image
}
"
flavor_name
=
"
${
var
.
flavor
}
"
key_pair
=
"
${
var
.
key
_
pair
}
"
key_pair
=
"
${
openstack_compute_keypair_v2
.
test-
keypair
.
name
}
"
security_groups
=
[
"default"
]
# defines the networks of the instance
...
...
@@ -67,20 +71,3 @@ resource "openstack_compute_floatingip_associate_v2" "ohpc" {
}
}
# creates details for the instance using variables defined in vars.tf
resource
"openstack_compute_instance_v2"
"ohpc"
{
name
=
"ohpc"
image_name
=
"
${
var
.
image
}
"
flavor_name
=
"
${
var
.
flavor
}
"
key_pair
=
"
${
var
.
key_pair
}
"
security_groups
=
[
"default"
]
# defines the networks of the instance
network
{
name
=
"dmznet"
}
network
{
name
=
"clusternet"
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment