diff --git a/puppet/bootstrap-server.sh b/puppet/bootstrap-server.sh index bd8a59a..775631b 100755 --- a/puppet/bootstrap-server.sh +++ b/puppet/bootstrap-server.sh @@ -37,24 +37,27 @@ FQDN="$(hostname -f)" mkdir -p /etc/puppet/manifests/node -cat > /etc/puppet/manifests/site.pp << EOF +if [ ! -s /etc/puppet/manifests/site.pp ]; then + cat > /etc/puppet/manifests/site.pp << EOF import "node/*.pp" \$puppet_server = "${FQDN}" EOF +fi -cat > /etc/puppet/manifests/node/${FQDN}.pp << EOF +if [ ! -s /etc/puppet/manifests/node/${FQDN}.pp ]; then + cat > /etc/puppet/manifests/node/${FQDN}.pp << EOF node "${FQDN}" { EOF -if [ "${SERVER}" = "apache" -a -f /etc/redhat-release ]; then - cat >> /etc/puppet/manifests/node/${FQDN}.pp << EOF + if [ "${SERVER}" = "apache" -a -f /etc/redhat-release ]; then + cat >> /etc/puppet/manifests/node/${FQDN}.pp << EOF include user::system realize(User["httpsd"], Group["httpsd"]) EOF -fi + fi cat >> /etc/puppet/manifests/node/${FQDN}.pp << EOF include puppet::server::${SERVER} @@ -62,6 +65,7 @@ cat >> /etc/puppet/manifests/node/${FQDN}.pp << EOF } EOF +fi puppet cert --keylength 4096 --list puppet apply --no-report --tags bootstrap /etc/puppet/manifests/site.pp