Skip to content

Commit

Permalink
Let's try_sudo for running commands, work's best with EC2 ubuntu imag…
Browse files Browse the repository at this point in the history
…es that doesn't allow root login
  • Loading branch information
Victor Castell committed Oct 25, 2012
1 parent b710cda commit 9746d3f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/provizioning/puppet.rb
Expand Up @@ -12,7 +12,7 @@
desc "Deploy our puppet recipes to the server"
task :deploy_recipes do
with_puppet_user do
run "rm -rf #{puppet_path}"
run "#{try_sudo} rm -rf #{puppet_path}"
upload File.expand_path("../../../puppet", __FILE__), puppet_path
end
end
Expand All @@ -35,7 +35,7 @@
desc 'Bootstrap puppet'
task :bootstrap do
with_puppet_user do
run "wget -q -O - https://raw.github.com/seasonlabs/provizioning/master/bootstrap/bootstrap.sh | sh"
run "wget -q -O - https://raw.github.com/seasonlabs/provizioning/master/bootstrap/bootstrap.sh | #{try_sudo} sh"
end
end

Expand Down Expand Up @@ -70,7 +70,7 @@ def apply_manifest(manifest, options = {})
dryrun_option = fetch('puppet_dryrun') ? "--noop " : ""
debug_option = fetch('puppet_debug') ? "-d " : ""
with_puppet_user do
run "puppet apply --modulepath '#{puppet_app_modules_path}:#{puppet_path}/modules' --templatedir #{puppet_path}/classes #{dryrun_option}-v #{debug_option}#{manifest}", options
run "#{try_sudo} puppet apply --modulepath '#{puppet_app_modules_path}:#{puppet_path}/modules' --templatedir #{puppet_path}/classes #{dryrun_option}-v #{debug_option}#{manifest}", options
end
end

Expand Down

0 comments on commit 9746d3f

Please sign in to comment.