Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save DougBarry/d09f8c2310945969b2e6f3e5675b7f94 to your computer and use it in GitHub Desktop.
Save DougBarry/d09f8c2310945969b2e6f3e5675b7f94 to your computer and use it in GitHub Desktop.
#!/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