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
Krish Moodbidri
Terraform Openstack
Commits
985954f4
Commit
985954f4
authored
Dec 11, 2019
by
John-Paul Robinson
Browse files
Merge branch 'fix-provisioner-race-condition'
parents
7ce57e79
b65cbbeb
Changes
1
Hide whitespace changes
Inline
Side-by-side
main.tf
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
:
...
...
Write
Preview
Supports
Markdown
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