Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Lysator
Puppet
hiera
Commits
1eaba1fb
Commit
1eaba1fb
authored
Aug 28, 2020
by
Henrik Henriksson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update script
parent
c5ee8d17
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
new_host.sh
new_host.sh
+7
-4
No files found.
new_host.sh
View file @
1eaba1fb
...
...
@@ -4,11 +4,14 @@ FQDN=$1
# Add the host
ipa-getkeytab
-p
host/
${
FQDN
}
-k
/tmp/
${
FQDN
}
.keytab
||
exit
1
eyaml encrypt
--pkcs7-public-key
=
public_key.pkcs7.pem
--output
=
block
--label
=
ipa_client::keytab_content
--file
=
/tmp/
${
FQDN
}
.keytab |
tee
nodes/
${
FQDN
}
.yaml
/opt/puppetlabs/puppet/bin/
eyaml encrypt
--pkcs7-public-key
=
public_key.pkcs7.pem
--output
=
block
--label
=
ipa_client::keytab_content
--file
=
/tmp/
${
FQDN
}
.keytab |
tee
nodes/
${
FQDN
}
.yaml
shred
/tmp/
${
FQDN
}
.keytab
||
exit
1
rm
/tmp/
${
FQDN
}
.keytab
ROOT_PASSWORD
=
`
pwgen
-s
16
-N
1
`
echo
${
ROOT_PASSWORD
}
| mkpasswd
-R
5000000
-s
-m
sha-512 | eyaml encrypt
--pkcs7-public-key
=
public_key.pkcs7.pem
--output
=
block
--label
=
root::password
--stdin
|
tee
nodes/
${
FQDN
}
.yaml
echo
"Generated password for the server:
${
ROOT_PASSWORD
}
"
echo
"Save it or delete it from nodes/
${
FQDN
}
.yaml"
echo
${
ROOT_PASSWORD
}
| mkpasswd
-R
5000000
-s
-m
sha-512 | /opt/puppetlabs/puppet/bin/eyaml encrypt
--pkcs7-public-key
=
public_key.pkcs7.pem
--output
=
block
--label
=
profiles::root::password
--stdin
|
tee
nodes/
${
FQDN
}
.yaml
echo
""
echo
"The output above has been saved to nodes/
${
FQDN
}
.yaml."
echo
"Please commit the file and push it."
echo
-e
"
\e
[32mGenerated password for the server:
\e
[39m
${
ROOT_PASSWORD
}
"
echo
-e
"
\e
[35mSave the password or delete the entry from nodes/
${
FQDN
}
.yaml
\e
[39m"
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