From 904fa1187e3cff9c270afd442cb28b9e0c1223df Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= <valtri@civ.zcu.cz>
Date: Sun, 21 Mar 2021 21:10:01 +0100
Subject: [PATCH] Hadoop: better to use master-less mode for puppet in single
 machine setup

---
 image/scripts/hadoop-single-setup.sh | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/image/scripts/hadoop-single-setup.sh b/image/scripts/hadoop-single-setup.sh
index 5c5504d..1450fda 100755
--- a/image/scripts/hadoop-single-setup.sh
+++ b/image/scripts/hadoop-single-setup.sh
@@ -12,22 +12,15 @@ fi
 
 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
 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 apply --test $f 2>&1 | tee stage1.log
 if test $? = 0 -o $? = 2; then
 	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
 	echo "First stage setup failed"
 	exit $?
-- 
GitLab