Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
Terraform Openstack
Manage
Activity
Members
Labels
Plan
Issues
10
Issue boards
Milestones
Wiki
Code
Merge requests
6
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
rc
Terraform Openstack
Commits
6176393e
Commit
6176393e
authored
1 year ago
by
Eesaan Atluri
Committed by
Ravi Tripathi
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Add exisiting volume as an attachment
parent
b74ba02c
No related branches found
No related tags found
1 merge request
!8
Feat attach vol
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitlab-ci.yml
+1
-0
1 addition, 0 deletions
.gitlab-ci.yml
main.tf
+2
-0
2 additions, 0 deletions
main.tf
ohpc-instance/main.tf
+7
-1
7 additions, 1 deletion
ohpc-instance/main.tf
vars.tf
+1
-1
1 addition, 1 deletion
vars.tf
with
11 additions
and
2 deletions
.gitlab-ci.yml
+
1
−
0
View file @
6176393e
...
...
@@ -10,6 +10,7 @@ variables:
TF_ROOT
:
${CI_PROJECT_DIR}/
TF_VAR_external_network
:
"
xdmod-packer-dmznet"
TF_VAR_flavor
:
"
m1.medium"
TF_VAR_data_volume
:
"
xdmod-mysql-db-migration"
GIT_SUBMODULE_STRATEGY
:
"
recursive"
GIT_SUBMODULE_UPDATE_FLAGS
:
"
--force"
...
...
This diff is collapsed.
Click to expand it.
main.tf
+
2
−
0
View file @
6176393e
...
...
@@ -55,6 +55,7 @@ output "keypair_name" {
}
data
"openstack_networking_network_v2"
"external_net"
{
name
=
var
.
external_network
}
data
"openstack_blockstorage_volume_v2"
"disk"
{
name
=
var
.
data_volume
}
# runs the ohpc-instance module - creates ohpc instance using variables defined above
# calls functions from dmz-network, import-keypair, and floating-ip-address modules to get values created there for use
...
...
@@ -70,6 +71,7 @@ module "create-ohpc-instance" {
floating_ip_ohpc
=
module
.
floating-ip-address
.
ohpc_address
ohpc_user
=
var
.
ohpc_user
ssh_private_key
=
var
.
ssh_private_key
vol_id
=
data
.
openstack_blockstorage_volume_v2
.
disk
.
id
}
# runs the ood-instance module - creates ood instance using variables defined above
...
...
This diff is collapsed.
Click to expand it.
ohpc-instance/main.tf
+
7
−
1
View file @
6176393e
...
...
@@ -26,7 +26,7 @@ variable "floating_ip_ohpc" {type = string}
variable
"ohpc_user"
{}
variable
"ssh_private_key"
{}
variable
"vol_id"
{}
# creates details for the OHPC instance
resource
"openstack_compute_instance_v2"
"ohpc"
{
...
...
@@ -61,6 +61,12 @@ resource "openstack_compute_floatingip_associate_v2" "ohpc" {
instance_id
=
openstack_compute_instance_v2
.
ohpc
.
id
}
# Attach a volume
resource
"openstack_compute_volume_attach_v2"
"volume_attach"
{
instance_id
=
openstack_compute_instance_v2
.
ohpc
.
id
volume_id
=
var
.
vol_id
}
output
"id"
{
value
=
openstack_compute_instance_v2
.
ohpc
.
id
}
...
...
This diff is collapsed.
Click to expand it.
vars.tf
+
1
−
1
View file @
6176393e
...
...
@@ -25,7 +25,7 @@ variable "external_network" {default = "dmznet"}
variable
"ohpc_user"
{
default
=
"centos"
}
variable
"ood_user"
{
default
=
"centos"
}
variable
"ssh_private_key"
{
default
=
"~/.ssh/id_rsa"
}
variable
"data_volume"
{
default
=
""
}
# variables for node creation module
variable
"image_compute"
{
default
=
"compute-v1"
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment