Created
June 2, 2019 13:45
-
-
Save DougBarry/d09f8c2310945969b2e6f3e5675b7f94 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PUPPETFILE=/puppet/Puppetfile | |
MODULEDIR=/puppet/modules/ | |
PUPPET=/opt/puppetlabs/bin/puppet | |
MODULES=( `cat ${PUPPETFILE} | grep mod | awk ' { print $2 } ' | tr -d \' | tr -d , | tr -d \"` ) | |
for MODULE in "${MODULES[@]}" | |
do | |
VERSION=`cat ${PUPPETFILE} | grep ${MODULE} | awk ' { print $3 } ' | tr -d \' | tr -d , | tr -d \"` | |
sudo ${PUPPET} module install --modulepath ${MODULEDIR} ${MODULE} --version ${VERSION} --force | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment