Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aded puppet:bootstrap:debian and fixed some sudo issues. #53

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 37 additions & 11 deletions lib/supply_drop/tasks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,36 +18,62 @@
namespace :bootstrap do
desc "installs puppet via rubygems on an osx host"
task :osx do
if fetch(:use_sudo, true)
run "#{sudo} gem install puppet --no-ri --no-rdoc"
else
run "gem install puppet --no-ri --no-rdoc"
end
run "#{try_sudo}gem install puppet --no-ri --no-rdoc"
end

desc "installs puppet via apt on an ubuntu host"
task :ubuntu do
run "mkdir -p #{puppet_destination}"
run "#{sudo} apt-get update"
run "#{sudo} apt-get install -y puppet rsync"
run "#{try_sudo} apt-get update"
run "#{try_sudo} apt-get install -y puppet rsync"
end

desc "installs puppet via apt on an debian host"
task :debian do
run "mkdir -p #{puppet_destination}"
run "#{try_sudo} apt-get update"
run "#{try_sudo} apt-get install -y puppet rsync"
end

desc "installs puppet via yum on a centos/red hat host"
task :redhat do
run "mkdir -p #{puppet_destination}"
run "#{sudo} yum -y install puppet rsync"
run "#{try_sudo} yum -y install puppet rsync"
end

namespace :puppetlabs do

desc "setup the puppetlabs repo, then install via the normal method"
task :ubuntu do
run "echo deb http://apt.puppetlabs.com/ $(lsb_release -sc) main | #{sudo} tee /etc/apt/sources.list.d/puppet.list"
run "echo deb http://apt.puppetlabs.com/ $(lsb_release -sc) dependencies | #{sudo} tee -a /etc/apt/sources.list.d/puppet.list"
run "#{sudo} apt-key adv --keyserver keyserver.ubuntu.com --recv 4BD6EC30"
run "echo deb http://apt.puppetlabs.com/ $(lsb_release -sc) main | #{try_sudo} tee /etc/apt/sources.list.d/puppet.list"
run "echo deb http://apt.puppetlabs.com/ $(lsb_release -sc) dependencies | #{try_sudo} tee -a /etc/apt/sources.list.d/puppet.list"
run "#{try_sudo} apt-key adv --keyserver keyserver.ubuntu.com --recv 4BD6EC30"
puppet.bootstrap.ubuntu
end

desc "setup the puppetlabs repo, then install via the normal method"
task :debian do
case capture("cat /etc/debian_version")
when /(6(\.\d){1,2}|squeeze)/
deb_ver = "squeeze"
when /(7(\.\d){1,2}|wheezy)/
deb_ver = "wheezy"
when /(8(\.\d){1,2}|jessie)/
deb_ver = "testing"
else
deb_ver = false
end

if deb_ver
run "echo deb http://apt.puppetlabs.com/ #{deb_ver} main | #{try_sudo} tee /etc/apt/sources.list.d/puppet.list"
run "echo deb http://apt.puppetlabs.com/ #{deb_ver} dependencies | #{try_sudo} tee -a /etc/apt/sources.list.d/puppet.list"
run "#{try_sudo} apt-key adv --keyserver keyserver.ubuntu.com --recv 4BD6EC30"
puppet.bootstrap.debian
else
logger.info "This debian version is currently not supported by Puppetlabs."
end
end

desc "setup the puppetlabs repo, then install via the normal method"
task :redhat do
logger.info "PuppetLabs::RedHat bootstrap is not implemented yet"
Expand Down