Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
Terraform Openstack
Manage
Activity
Members
Labels
Plan
Issues
10
Issue boards
Milestones
Wiki
Code
Merge requests
6
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
rc
Terraform Openstack
Commits
d2a09faa
Commit
d2a09faa
authored
5 years ago
by
Krish Moodbidri
Committed by
John-Paul Robinson
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
added user_data commands
parent
899f30ea
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ood-instance/main.tf
+15
-2
15 additions, 2 deletions
ood-instance/main.tf
with
15 additions
and
2 deletions
ood-instance/main.tf
+
15
−
2
View file @
d2a09faa
...
...
@@ -28,6 +28,14 @@ resource "openstack_compute_instance_v2" "ood" {
flavor_name
=
var
.
flavor
key_pair
=
var
.
key_pair
security_groups
=
[
"default"
]
user_data
=
<<-
EOF
#cloud-config
runcmd
:
-
[
bash
,
-
xc
,
'ethernet=
$
(cat /sys/class/net/eth0/address); nodename=
$
(hostname -s); sed -e "s/MY_HWADDR/
$
ethernet/" -e "s/MY_NODENAME/
$
nodename/" -i /warewulf/config;'
]
-
[
bash
,
-
xc
,
"echo
$
(date) ': hello world!'; until WWGETFILES_INTERVAL=0 bash -x /warewulf/bin/wwgetfiles; do echo waiting ; rm -f /tmp/.wwgetfile.lock ; sleep 10; done;"
]
-
[
bash
,
-
xc
,
"systemctl restart munge"
]
EOF
# defines the networks of the instance
network
{
...
...
@@ -53,7 +61,12 @@ resource "openstack_compute_floatingip_associate_v2" "ood" {
}
output
"id"
{
value
=
openstack_compute_instance_v2
.
ood
.
id
}
output
"ssh_host"
{
value
=
format
(
var
.
host_prefix
,
element
(
split
(
"."
,
var
.
floating_ip_ood
),
3
,),)
}
\ No newline at end of file
}
output
"network"
{
value
=
openstack_compute_instance_v2
.
ood
.
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