Skip to content

Instantly share code, notes, and snippets.

@tomohiro
Last active December 25, 2015 20:59
Show Gist options
  • Save tomohiro/7039774 to your computer and use it in GitHub Desktop.
Save tomohiro/7039774 to your computer and use it in GitHub Desktop.
Puppet install script
#!/bin/sh
ARCH=$(uname -i)
if [ -f /etc/system-release ]; then
# Red Hat Enterprise Linux (Install Ruby and RubyGems)
if [ $(readlink /etc/system-release) = 'redhat-release' ]; then
yum -y install yum-utils
yum-config-manager --enable rhel-6-server-optional-rpms
yum -y install ruby ruby-rdoc
rpm -ivh "http://rpmfind.net/linux/centos/6.4/os/${ARCH}/Packages/rubygems-1.3.7-1.el6.noarch.rpm"
fi
rpm -ivh "http://yum.puppetlabs.com/el/6/products/${ARCH}/puppetlabs-release-6-7.noarch.rpm"
yum -y install puppet facter
# For sudo command over SSH protocol. This setting is RHEL only.
sed -i 's/^.*requiretty/#Defaults requiretty/' /etc/sudoers
fi
if [ -f /etc/debian_version ]; then
sudo apt-get -y install puppet facter
fi
if [ -d /etc/puppet ]; then
sudo rm -rf /etc/puppet/modules
sudo chgrp -R adm /etc/puppet
sudo chmod -R 775 /etc/puppet
echo '/etc/puppets permission changed'
fi
echo 'Finish'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment