supply_drop 0.8.1 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README.md +4 -0
  2. data/lib/supply_drop.rb +14 -5
  3. metadata +9 -6
data/README.md CHANGED
@@ -81,6 +81,10 @@ experimental feature and is quite slow at the moment.
81
81
 
82
82
  a file to additionally write puppet output to, useful for large noops with small scrollbacks.
83
83
 
84
+ set :puppet_runner, nil
85
+
86
+ allows you to specify the user to execute the puppet command as. Like running sudo -u puppet args from the command line.
87
+
84
88
  ### Handling Legacy Puppet
85
89
 
86
90
  Puppet deprecated the implicit invocation of apply [in the 2.6.x series](https://github.com/puppetlabs/puppet/commit/a23cfd869f90ae4456dded6e5a1c82719b128f01).
data/lib/supply_drop.rb CHANGED
@@ -19,6 +19,7 @@ Capistrano::Configuration.instance.load do
19
19
  set :puppet_parallel_rsync, true
20
20
  set :puppet_syntax_check, false
21
21
  set :puppet_write_to_file, nil
22
+ set :puppet_runner, nil
22
23
 
23
24
  namespace :bootstrap do
24
25
  desc "installs puppet via rubygems on an osx host"
@@ -87,19 +88,18 @@ Capistrano::Configuration.instance.load do
87
88
  desc "runs puppet with --noop flag to show changes"
88
89
  task :noop, :except => { :nopuppet => true } do
89
90
  update_code
90
- puppet :noop
91
+ _puppet :noop
91
92
  end
92
93
 
93
94
  desc "applies the current puppet config to the server"
94
95
  task :apply, :except => { :nopuppet => true } do
95
96
  update_code
96
- puppet :apply
97
+ _puppet :apply
97
98
  end
98
99
  end
99
100
 
100
- def puppet(command = :noop)
101
- sudo_cmd = fetch(:use_sudo, true) ? sudo : ''
102
- puppet_cmd = "cd #{puppet_destination} && #{sudo_cmd} #{puppet_command} --modulepath=#{puppet_lib} #{puppet_parameters}"
101
+ def _puppet(command = :noop)
102
+ puppet_cmd = "cd #{puppet_destination} && #{_sudo_cmd} #{puppet_command} --modulepath=#{puppet_lib} #{puppet_parameters}"
103
103
  flag = command == :noop ? '--noop' : ''
104
104
 
105
105
  writer = if puppet_stream_output
@@ -119,4 +119,13 @@ Capistrano::Configuration.instance.load do
119
119
  writer.all_output_collected
120
120
  end
121
121
  end
122
+
123
+ def _sudo_cmd
124
+ if fetch(:use_sudo, true)
125
+ sudo(:as => puppet_runner)
126
+ else
127
+ logger.info "NOTICE: puppet_runner configuration invalid when use_sudo is false, ignoring..." unless puppet_runner.nil?
128
+ ''
129
+ end
130
+ end
122
131
  end
metadata CHANGED
@@ -1,26 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: supply_drop
3
3
  version: !ruby/object:Gem::Version
4
- hash: 61
4
+ hash: 59
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 8
9
- - 1
10
- version: 0.8.1
8
+ - 9
9
+ - 0
10
+ version: 0.9.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Tony Pitluga
14
+ - Paul Hinze
14
15
  autorequire:
15
16
  bindir: bin
16
17
  cert_chain: []
17
18
 
18
- date: 2012-03-26 00:00:00 -05:00
19
+ date: 2012-04-05 00:00:00 -05:00
19
20
  default_executable:
20
21
  dependencies: []
21
22
 
22
23
  description: See http://github.com/pitluga/supply_drop
23
- email: tony.pitluga@gmail.com
24
+ email:
25
+ - tony.pitluga@gmail.com
26
+ - paul.t.hinze@gmail.com
24
27
  executables: []
25
28
 
26
29
  extensions: []