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

Hadoop: better to use master-less mode for puppet in single machine setup

parent 29442275
No related branches found
No related tags found
No related merge requests found
Pipeline #617 canceled
...@@ -12,22 +12,15 @@ fi ...@@ -12,22 +12,15 @@ fi
mkdir /data 2>/dev/null || : mkdir /data 2>/dev/null || :
apt-get install -y puppet-master
hostname -f > /etc/puppet/autosign.conf
systemctl enable puppet-master
service puppet-master restart
puppet config set server `hostname -f`
puppet config set --section agent http_read_timeout 30
f=/etc/puppet/code/environments/production/manifests/site.pp f=/etc/puppet/code/environments/production/manifests/site.pp
while grep -q '@SECRET@' $f; do while grep -q '@SECRET@' $f; do
k="`dd if=/dev/random bs=27 count=1 2>/dev/null | base64 -`" k="`dd if=/dev/random bs=27 count=1 2>/dev/null | base64 -`"
sed -i "0,/@SECRET@/s,@SECRET,$k," $f sed -i "0,/@SECRET@/s,@SECRET,$k," $f
done done
puppet agent --test 2>&1 | tee stage1.log puppet apply --test $f 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/" $f sed -i "s/^\\(\$hdfs_deployed\\s*=\\s*\\).*/\\1true/" $f
puppet agent --test 2>&1 | tee stage2.log puppet apply --test $f 2>&1 | tee stage2.log
else else
echo "First stage setup failed" echo "First stage setup failed"
exit $? exit $?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment