#! /bin/bash
echo - e " "
echo - e " ************************************************************************************************"
echo - e " Parsing Puppet Environment"
echo - e " ************************************************************************************************"
echo - e " "
cd /opt/ git/ && git clone gogs@mydomain.com:puppet/ puppet- production.git production
if [ " $?" = " 0" ]; then
echo - e " INFO - Git Pull is successful"
else
echo - e " ERROR - An error occurred while running Git Pull!"
exit 1
fi
echo - e " INFO - Runnign Puppet-Lint..."
cd /opt/ git/ && / usr/local/ bin /puppet-lint production/
if [ " $?" = " 0" ]; then
echo - e " INFO - Puppet-Lint is successfully ended"
rm /opt/ git/production - rf
else
echo - e " ERROR - An error occurred while running puppet-lint!"
rm /opt/ git/production - rf
exit 1
fi
curl - k - u " $FUSER" :" $FPASSWD" - H " Content-Type: application/json" - X POST https: // foreman.mydomain.com /api/ smart_proxies/1/ import_puppetclasses
Execute shell script on remote host using ssh
SSH site puppet@foreman.mydomain.com
Command `cd /etc/puppetlabs/code/environments/production/; git pull && git submodule update --init`