Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
terraform
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
702
HADOOP
terraform
Commits
eed1456d
Commit
eed1456d
authored
4 years ago
by
František Dvořák
Browse files
Options
Downloads
Patches
Plain Diff
Move generating of the secrets to terraform
parent
48f5014e
No related branches found
No related tags found
No related merge requests found
Pipeline
#557
passed
4 years ago
Stage: build
Changes
3
Pipelines
4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
deploy.tf
+11
-3
11 additions, 3 deletions
deploy.tf
launch.sh
+0
-12
0 additions, 12 deletions
launch.sh
secrets.auto.tfvars.example
+0
-5
0 additions, 5 deletions
secrets.auto.tfvars.example
with
11 additions
and
20 deletions
deploy.tf
+
11
−
3
View file @
eed1456d
...
...
@@ -135,8 +135,12 @@ resource "openstack_compute_volume_attach_v2" "volume-attach" {
volume_id
=
openstack_blockstorage_volume_v3
.
volume
[
count
.
index
].
id
}
variable
"secrets"
{
type
=
map
(
string
)
resource
"random_password"
"secrets"
{
count
=
3
length
=
"36"
keepers
=
{
masterid
=
openstack_compute_instance_v2
.
server
[
0
].
id
}
}
output
"config"
{
...
...
@@ -147,7 +151,11 @@ output "config" {
master_hostname
=
var
.
master_hostname
,
node_hostname
=
var
.
node_hostname
,
type
=
var
.
type
,
secrets
=
var
.
secrets
,
secrets
=
{
http_signature_secret
=
random_password
.
secrets
[
0
].
result
,
kerberos_admin_password
=
random_password
.
secrets
[
1
].
result
,
kerberos_master_password
=
random_password
.
secrets
[
2
].
result
,
},
volumes
=
var
.
volumes
,
}
sensitive
=
true
...
...
This diff is collapsed.
Click to expand it.
launch.sh
+
0
−
12
View file @
eed1456d
...
...
@@ -2,18 +2,6 @@
TERRAFORM
=
"
`
PATH
=
$PATH
:. which terraform
`
"
if
[
!
-s
./secrets.auto.tfvars
]
;
then
touch
./secrets.auto.tfvars
chmod
0600 ./secrets.auto.tfvars
{
echo
'secrets = {'
for
k
in
kerberos_master_password kerberos_admin_password http_signature_secret
;
do
echo
"
$k
=
\"
`
dd
if
=
/dev/random
bs
=
27
count
=
1 2>/dev/null |
base64
-
`
\"
"
done
echo
"}"
}
>>
./secrets.auto.tfvars
fi
$TERRAFORM
init
>
/dev/null
$TERRAFORM
apply
-auto-approve
"
$@
"
...
...
This diff is collapsed.
Click to expand it.
secrets.auto.tfvars.example
deleted
100644 → 0
+
0
−
5
View file @
48f5014e
secrets = {
kerberos_master_password = "SECRET"
kerberos_admin_password = "SECRET"
http_signature_secret = "SECRET"
}
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