Skip to content

Instantly share code, notes, and snippets.

@rchrd2
Created December 16, 2014 23:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rchrd2/365760241dd59a132d59 to your computer and use it in GitHub Desktop.
Save rchrd2/365760241dd59a132d59 to your computer and use it in GitHub Desktop.
install_puppet_modules.sh
#!/bin/bash
# This is a little script that will install the required puppet modules.
# It was written to help setup vagrant. It is called as a provision script.
#
# # This installs the modules
# config.vm.provision :shell do |shell|
# shell.path = "./puppet/install_puppet_modules.sh"
# end
#
# It's only needed on the puppet-master, not the puppet-agents.
# It is also needed on the vagrant box.
#
# @author http://github.com/rchrd2
echo "Installing puppet modules..."
target_dir=/etc/puppet/modules/
mkdir -p $target_dir
array=(
"ajcrowe-supervisord --version=0.5.0"
"darin-zypprepo --version=1.0.1"
"elasticsearch-elasticsearch --version=0.3.2"
"inkblot-github --version=1.0.0"
"jfryman-nginx --version=0.0.9"
"jhoblitt-ganglia --version=1.3.0"
"maestrodev-wget --version=1.4.1"
"pdxcat-nrpe --version=1.0.0"
"petems-swap_file --version=0.1.2"
"puppetlabs-apache --version=1.0.1"
"puppetlabs-apt --version=1.4.2"
"puppetlabs-concat --version=1.1.0"
"puppetlabs-firewall --version=1.1.1"
"puppetlabs-gcc --version=0.1.0"
"puppetlabs-git --version=0.0.3"
"puppetlabs-inifile --version=1.1.0"
"puppetlabs-java --version=1.1.2"
"puppetlabs-postgresql --version=3.4.2"
"puppetlabs-puppetdb --version=3.0.1"
"puppetlabs-stdlib --version=4.4.0"
"puppetlabs-vcsrepo --version=1.0.0"
"rtyler-jenkins --version=1.2.0"
"saz-memcached --version=2.4.0"
"saz-ssh --version=2.3.6"
"softek-java7 --version=0.1.0"
"stankevich-python --version=1.7.5"
"stephenrjohnson-puppet --version=0.0.21"
"thomasvandoren-redis --version=0.0.9"
"willdurand-nodejs --version=1.8.3"
)
curernt_module_list=`puppet module list`
for i in "${array[@]}"
do
name="$(echo $i | awk '{print $1}')"
(echo $curernt_module_list | grep --quiet $name) || (puppet module install --target-dir=$target_dir $i )
done
echo "done!"
@rchrd2
Copy link
Author

rchrd2 commented Dec 16, 2014

For ruby-impaired, this will do the trick of install puppet modules and their versions without having to install puppet librarian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment