Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
Terraform Openstack
Manage
Activity
Members
Labels
Plan
Issues
5
Issue boards
Milestones
Wiki
Code
Merge requests
3
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
John-Paul Robinson
Terraform Openstack
Commits
985954f4
Commit
985954f4
authored
5 years ago
by
John-Paul Robinson
Browse files
Options
Downloads
Plain Diff
Merge branch 'fix-provisioner-race-condition'
parents
7ce57e79
b65cbbeb
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
main.tf
+5
-23
5 additions, 23 deletions
main.tf
with
5 additions
and
23 deletions
main.tf
+
5
−
23
View file @
985954f4
...
...
@@ -112,8 +112,10 @@ output "ood-ssh_host" {
value
=
"
${module
.
create-ood-instance
.
ssh_host
}
"
}
# compute node post provision
resource
"null_resource"
"compute_ops"
{
# compute node and ood post provision
# use single null_resource for serial provisioner runs to avoid race conditions
# that lead to inconsistent deploy successes.
resource
"null_resource"
"ops"
{
triggers
=
{
ohpc_instance
=
module
.
create-ohpc-instance
.
id
compute_instances
=
join
(
","
,
module
.
nodes
.
id
)
...
...
@@ -137,28 +139,8 @@ resource "null_resource" "compute_ops" {
for
node
,
net
in
module
.
nodes
.
network
:
"ansible-playbook -c local -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
)
}
# moves CRI_XCBC file into directory made above
provisioner
"file"
{
source
=
"CRI_XCBC"
destination
=
"/"
}
# ood node
# ood node
provisioner
"remote-exec"
{
inline
=
[
for
net
in
module
.
create-ood-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