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
Chirag Chandrahas Shetty
Terraform Openstack
Commits
98c730f3
Commit
98c730f3
authored
5 years ago
by
John-Paul Robinson
Browse files
Options
Downloads
Plain Diff
Merge branch 'feat-ohpc-ops-provision'
parents
94fdf7e7
6f7a7295
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
external-network/main.tf
+2
-2
2 additions, 2 deletions
external-network/main.tf
main.tf
+21
-2
21 additions, 2 deletions
main.tf
ohpc-instance/main.tf
+9
-0
9 additions, 0 deletions
ohpc-instance/main.tf
with
32 additions
and
4 deletions
external-network/main.tf
+
2
−
2
View file @
98c730f3
...
...
@@ -20,7 +20,7 @@ resource "openstack_networking_subnet_v2" "external_subnet" {
network_id
=
openstack_networking_network_v2
.
external_network
.
id
cidr
=
"192.168.100.0/24"
ip_version
=
4
dns_nameservers
=
[
"8.8.8.8"
]
dns_nameservers
=
[
"172.20.0.137"
,
"172.20.0.3"
,
"8.8.8.8"
]
enable_dhcp
=
var
.
enable_dhcp
}
...
...
@@ -46,4 +46,4 @@ output "external_subnet_id" {
output
"router_id"
{
value
=
openstack_networking_router_v2
.
router
.
id
}
\ No newline at end of file
}
This diff is collapsed.
Click to expand it.
main.tf
+
21
−
2
View file @
98c730f3
...
...
@@ -129,7 +129,26 @@ resource "null_resource" "compute_ops" {
provisioner
"remote-exec"
{
inline
=
[
for
node
,
net
in
module
.
nodes
.
network
:
"ansible-playbook -i /CRI_XCBC/hosts -l `hostname -s` -e
\"
{'node_name':'
${
node
}
', 'node_ip_v4':'
${
net
[
0
].
fixed_ip_v4
}
', 'node_mac':'
${
net
[
0
].
mac
}
'}
\"
/CRI_XCBC/site-ops.yaml -b -v"
]
"ansible-playbook -i /CRI_XCBC/hosts -l `hostname -s` -e
\"
{'compute_nodes':[{'name':'
${
node
}
', 'ip':'
${
net
[
0
].
fixed_ip_v4
}
', 'mac':'
${
net
[
0
].
mac
}
', 'vnfs':'', 'sockets':'1', 'corespersocket':'1'}]}
\"
/CRI_XCBC/site-ops.yaml -b -v"
]
}
}
# ood node post provision
resource
"null_resource"
"ood_ops"
{
triggers
=
{
ohpc_instance
=
module
.
create-ohpc-instance
.
id
}
connection
{
host
=
module
.
create-ohpc-instance
.
ssh_host
user
=
var
.
ohpc_user
private_key
=
file
(
var
.
ssh_private_key
)
}
# ood node
provisioner
"remote-exec"
{
inline
=
[
for
net
in
module
.
create-ood-instance
.
network
:
"ansible-playbook -i /CRI_XCBC/hosts -l `hostname -s` -e
\"
{'compute_nodes':[{'name':'
${
var
.
ood_instance_name
}
', 'ip':'
${
net
.
fixed_ip_v4
}
', 'mac':'
${
net
.
mac
}
', 'vnfs':'', 'sockets':'1', 'corespersocket':'1'}]}
\"
/CRI_XCBC/site-ops.yaml -b -v"
]
}
}
This diff is collapsed.
Click to expand it.
ohpc-instance/main.tf
+
9
−
0
View file @
98c730f3
...
...
@@ -28,6 +28,15 @@ resource "openstack_compute_instance_v2" "ohpc" {
flavor_name
=
var
.
flavor
key_pair
=
var
.
key_pair
security_groups
=
[
"default"
]
user_data
=
<<-
EOF
#cloud-config
write_files
:
-
content
:
|
10.1
.
1.10
ohpc
ohpc
.
novalocal
owner
:
centos
:
centos
path
:
/
etc
/
hosts
permissions
:
0644
EOF
# defines the networks of the instance
network
{
...
...
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