Skip to content
Snippets Groups Projects
Commit 29442275 authored by František Dvořák's avatar František Dvořák
Browse files

Hadoop: fix secrets in single machine setup

parent a3157c74
No related branches found
No related tags found
No related merge requests found
Pipeline #610 passed
...@@ -23,9 +23,9 @@ ...@@ -23,9 +23,9 @@
"n": "0", "n": "0",
"node_hostname": "node", "node_hostname": "node",
"secrets": { "secrets": {
"http_signature_secret": "UNUSED", "http_signature_secret": "@SECRET@",
"kerberos_admin_password": "UNUSED", "kerberos_admin_password": "@SECRET@",
"kerberos_master_password": "UNUSED" "kerberos_master_password": "@SECRET@"
}, },
"type": "hadoop-single" "type": "hadoop-single"
} }
......
...@@ -19,9 +19,14 @@ service puppet-master restart ...@@ -19,9 +19,14 @@ service puppet-master restart
puppet config set server `hostname -f` puppet config set server `hostname -f`
puppet config set --section agent http_read_timeout 30 puppet config set --section agent http_read_timeout 30
f=/etc/puppet/code/environments/production/manifests/site.pp
while grep -q '@SECRET@' $f; do
k="`dd if=/dev/random bs=27 count=1 2>/dev/null | base64 -`"
sed -i "0,/@SECRET@/s,@SECRET,$k," $f
done
puppet agent --test 2>&1 | tee stage1.log puppet agent --test 2>&1 | tee stage1.log
if test $? = 0 -o $? = 2; then if test $? = 0 -o $? = 2; then
sed -i "s/^\\(\$hdfs_deployed\\s*=\\s*\\).*/\\1true/" /etc/puppet/code/environments/production/manifests/site.pp sed -i "s/^\\(\$hdfs_deployed\\s*=\\s*\\).*/\\1true/" $f
puppet agent --test 2>&1 | tee stage2.log puppet agent --test 2>&1 | tee stage2.log
else else
echo "First stage setup failed" echo "First stage setup failed"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment