lib/supply_drop/tasks.rb in supply_drop-0.16.1 vs lib/supply_drop/tasks.rb in supply_drop-0.17.0

- old
+ new

@@ -12,41 +12,58 @@ set :puppet_parallel_rsync_pool_size, 10 set :puppet_syntax_check, false set :puppet_write_to_file, nil set :puppet_runner, nil set :puppet_lock_file, '/tmp/puppet.lock' + set :hiera_package, nil namespace :bootstrap do - desc "installs puppet via rubygems on an osx host" + desc "installs puppet and hiera via rubygems on an osx host" task :osx do if fetch(:use_sudo, true) - run "#{sudo} gem install puppet --no-ri --no-rdoc" + run "#{sudo} gem install puppet hiera --no-ri --no-rdoc" else run "gem install puppet --no-ri --no-rdoc" end end + desc "installs puppet via apt on a debian host" + task :debian do + run "mkdir -p #{puppet_destination}" + run "#{sudo} apt-get update" + run "#{sudo} apt-get install -y puppet #{hiera_package} rsync" + 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 "#{sudo} apt-get install -y puppet #{hiera_package} 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" end namespace :puppetlabs do - desc "setup the puppetlabs repo, then install via the normal method" task :ubuntu do + set :hiera_package, "hiera" 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" puppet.bootstrap.ubuntu + end + + desc "setup the puppetlabs repo, then install via the normal method" + task :debian do + set :hiera_package, "hiera" + 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" + puppet.bootstrap.debian end desc "setup the puppetlabs repo, then install via the normal method" task :redhat do logger.info "PuppetLabs::RedHat bootstrap is not implemented yet"