Skip to content

Commit

Permalink
Merge pull request #48 from seanscottking/debian_provision_shellscript
Browse files Browse the repository at this point in the history
More Debian compatibility
  • Loading branch information
Sean S. King committed Feb 24, 2016
2 parents fcac205 + 0579a81 commit 74fb2b7
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 29 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ This project serves as a complete starter kit for your Puppet controlled infrast
## Project Goals

1. Whitelabel so that anyone can use this project from a class demo all the way to a full blown Fortune 500 datacenter
2. Compatible with all operating systems (needs work)
3. Stay current with all the best practices
1. Compatible with as many operating systems as possible
1. Stay current with all the best practices

## Installation and Usage

1. Clone the repo
2. Install some vagrant plugins
3. `vagrant plugin install vagrant-cachier`
4. `vagrant plugin install vagrant-r10k`
1. Install some vagrant plugins
1. `vagrant plugin install vagrant-cachier`
1. `vagrant plugin install vagrant-r10k`
1. `vagrant up` and watch your new virtual machine get fully provisioned
1. `vagrant ssh` and have a look around
1. Now try making a change to some YAML data. Edit [`common.yaml`](hieradata/common.yaml) and add/remove a DNS server, just for fun
Expand All @@ -32,7 +32,7 @@ $ APP_ROLE=webserver APP_TIER=production vagrant provision

## Compatibility

Tested with Puppet v3.8 (open source) on CentOS 6.7. PRs with modifications for more compatibility are very welcome.
Tested with Puppet v3.8 (open source) on CentOS 6.7 and Ubuntu Server 14.04 LTS.

## Contributing

Expand Down
54 changes: 32 additions & 22 deletions Vagrant-puppet/install_puppet.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/bash


e() {
echo "$0: $@"
}
Expand All @@ -13,33 +12,44 @@ if [[ $EUID -ne 0 ]]; then
exit 1
fi

if [ "$(which puppet)" ]; then
# Puppet already installed, exiting silently
exit 0
fi

if [ -f /etc/redhat-release ]; then

yum install -y redhat-lsb-core
if [ -f '/etc/redhat-release' ]; then

case "$(lsb_release -sr | cut -d'.' -f1)" in
if [ "$(which puppet)" ]; then
# Puppet already installed, exiting silently
exit 0
else

6)
yum install -y http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum install -y https://yum.puppetlabs.com/puppetlabs-release-el-6.noarch.rpm
;;
yum install -y redhat-lsb-core

*)
err "Unsupported Operating System Version"
exit 1
;;

esac
case "$(lsb_release -sr | cut -d'.' -f1)" in

6)
yum install -y http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum install -y https://yum.puppetlabs.com/puppetlabs-release-el-6.noarch.rpm
;;

*)
err "Unsupported Operating System Version"
exit 1
;;

esac
fi

yum install -y puppet

#elif [ -f /etc/debian_version ]; then
# # do some Debian stuff here
elif [ -f '/etc/debian_version' ]; then

if [ "$(dpkg -S puppetlabs-release 2>/dev/null)" ]; then
# Puppet repo already installed, exiting silently
exit 0
else
SHORT_CODENAME="$(lsb_release -c -s)"
wget -O /tmp/puppetlabs-release-"$SHORT_CODENAME".deb https://apt.puppetlabs.com/puppetlabs-release-"$SHORT_CODENAME".deb
dpkg -i /tmp/puppetlabs-release-"$SHORT_CODENAME".deb
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confnew" install puppet
fi

else
err "Unsupported Operating System"
Expand Down
2 changes: 1 addition & 1 deletion modules/logrotate
Submodule logrotate updated from 39e731 to 320689

0 comments on commit 74fb2b7

Please sign in to comment.