clean up some tasks

This commit is contained in:
John Bintz 2012-08-02 11:17:45 -04:00
parent 00e10a4b96
commit 5d8aefeee3
4 changed files with 9 additions and 2 deletions

View File

@ -33,6 +33,7 @@ Capistrano::Configuration.instance.load do
_cset(:rename_server) { true }
_cset(:use_sudo) { true }
_cset(:run_as_user) { false }
_cset(:additional_modules) { [] }
_cset(:additional_puppet_options) { '' }
@ -61,7 +62,11 @@ Capistrano::Configuration.instance.load do
def as_user(cmd)
if use_sudo
%{#{sudo} su -c "#{cmd}" #{user}}
if run_as_user
%{#{sudo} su -c "#{cmd}" #{user}}
else
%{#{sudo} #{cmd}}
end
else
cmd
end

View File

@ -6,6 +6,7 @@ Capistrano::Configuration.instance.load do
set(:user) { 'vagrant' }
set(:password) { 'vagrant' }
set(:use_sudo) { true }
set(:run_as_user) { false }
task :ensure_puppet do
require 'socket'

View File

@ -67,6 +67,7 @@ class squid($version = '', $user = 'proxy', $group = 'proxy', $config_template,
command => "${sbin}/squid3 -z",
logoutput => true,
require => Exec[cache_dir_perms, log_dir_params],
unless => "test -d ${cache_dir}/00",
path => $::base::path
}

View File

@ -3,7 +3,7 @@ define remotedeb($url, $version) {
exec { "remotedeb-${name}":
command => "curl -o ${deb} ${url} && dpkg -i ${deb}",
unless => "test $(dpkg -l ${name} | grep ${version} | wc -l) -ne 0",
unless => "test $(dpkg -l ${name} | grep ${version} | wc -l) -eq 0",
path => $base::path
}
}