Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
Terraform Openstack
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
Ravi Tripathi
Terraform Openstack
Commits
ba5601a8
Commit
ba5601a8
authored
5 years ago
by
Ryan Jones
Browse files
Options
Downloads
Patches
Plain Diff
updated pub and private key info
parent
4b487db4
Branches
variable-update-branch
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
main.tf
+12
-12
12 additions, 12 deletions
main.tf
vars.tf
+3
-5
3 additions, 5 deletions
vars.tf
with
15 additions
and
17 deletions
main.tf
+
12
−
12
View file @
ba5601a8
resource
"openstack_compute_keypair_v2"
"keypair"
{
name
=
"
${
var
.
keypair-name
}
"
public_key
=
"
${
var
.
ssh_public_key
}
"
}
public_key
=
"
${
file
(
var
.
ssh_public_key
)
}
"
}
#local variable for ssh connect to ohpc
#
locals {
#
connection = {
#
host = "${format("164.111.161.%s", element(split(".", openstack_networking_floatingip_v2.ip_pool.address),3))}"
#
user = "centos"
#
private_key = "${file(
"~/
.ssh
/id_rsa"
)}"
#
}
#
}
locals
{
connection
=
{
host
=
"
${
format
(
"164.111.161.%s"
,
element
(
split
(
"."
,
openstack_networking_floatingip_v2
.
ip_pool
.
address
),
3
))
}
"
user
=
"centos"
private_key
=
"
${
file
(
var
.
ssh
_private_key
)
}
"
}
}
# creates dmznet
resource
"openstack_networking_network_v2"
"dmznet"
{
...
...
@@ -88,7 +88,7 @@ resource "openstack_compute_floatingip_associate_v2" "ohpc" {
connection
{
host
=
"
${
format
(
"164.111.161.%s"
,
element
(
split
(
"."
,
openstack_networking_floatingip_v2
.
ip_pool
.
address
),
3
))
}
"
user
=
"centos"
private_key
=
"
${
var
.
ssh_private_key
}
"
private_key
=
"
${
file
(
var
.
ssh_private_key
)
}
"
}
inline
=
[
...
...
@@ -108,7 +108,7 @@ resource "openstack_compute_floatingip_associate_v2" "ohpc" {
host
=
"
${
format
(
"164.111.161.%s"
,
element
(
split
(
"."
,
openstack_networking_floatingip_v2
.
ip_pool
.
address
),
3
))
}
"
#host = "${openstack_networking_floatingip_v2.terraform.address}"
user
=
"centos"
private_key
=
"
${
var
.
ssh_private_key
}
"
private_key
=
"
${
file
(
var
.
ssh_private_key
)
}
"
}
}
...
...
@@ -117,7 +117,7 @@ resource "openstack_compute_floatingip_associate_v2" "ohpc" {
host
=
"
${
format
(
"164.111.161.%s"
,
element
(
split
(
"."
,
openstack_networking_floatingip_v2
.
ip_pool
.
address
),
3
))
}
"
#host = "${openstack_networking_floatingip_v2.ohpc.address}"
user
=
"centos"
private_key
=
"
${
var
.
ssh_private_key
}
"
private_key
=
"
${
file
(
var
.
ssh_private_key
)
}
"
}
inline
=
[
"sudo ansible-playbook -c local -i /CRI_XCBC/hosts -l `hostname -s` /CRI_XCBC/site.yaml -b"
...
...
This diff is collapsed.
Click to expand it.
vars.tf
+
3
−
5
View file @
ba5601a8
...
...
@@ -16,18 +16,16 @@ variable "keypair-name" {
variable
"ssh_public_key"
{
description
=
"Path to file containing public key"
default
=
"~/.ssh/id_rsa.pub"
default
=
"~/.ssh/id_rsa.pub"
}
variable
"ssh_private_key"
{
description
=
"Path to file containing private key"
default
=
"~/.ssh/id_rsa"
default
=
"~/.ssh/id_rsa"
}
variable
"enable-dhcp"
{
description
=
"whether dhcp in enabled. defualt is true"
default
=
true
}
\ No newline at end of file
}
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