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
Bo-Chun Chen
Terraform Openstack
Commits
2e2192e4
Commit
2e2192e4
authored
Jun 27, 2019
by
Ryan Randles Jones
Browse files
Update main.tf
parent
5bf584c0
Changes
1
Hide whitespace changes
Inline
Side-by-side
main.tf
View file @
2e2192e4
...
...
@@ -115,3 +115,32 @@ resource "openstack_compute_interface_attach_v2" "terraform2" {
network_id
=
"
${
openstack_networking_network_v2
.
terraform2
.
id
}
"
}
provisioner
"remote-exec"
{
inline
=
[
"hostnamectl set-hostname ohpc"
,
"yum install -y epel-release"
,
"yum install -y ansible git vim bash-completion"
,
"yum install -y NetworkManager"
,
"systemctl restart NetworkManager"
,
"nmcli con mod 'Wired connection 1' connection.id 'eth1'"
,
]
connection
{
host
=
"
${
self
.
ipv4_address
}
"
# The `self` variable is like `this` in many programming languages
type
=
"ssh"
# in this case, `self` is the resource (the server).
user
=
"root"
private_key
=
"
${
file
(
"~/.ssh/id_rsa"
)
}
"
}
}
provisioner
"local-exec"
{
environment
{
PUBLIC_IP
=
"
${
self
.
ipv4_address
}
"
PRIVATE_IP
=
"
${
self
.
ipv4_address_private
}
"
}
working_dir
=
"
$
HOME/terraform-first-instance/terraform-openstack/CRI_XCBC/"
command
=
"ansible-playbook -c local -i hosts -l `hostname` site.yaml -b,"
}
}
Write
Preview
Markdown
is supported
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