chef-sudo 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/{README.rdoc → README.md} +28 -5
- data/chef-sudo.gemspec +1 -1
- data/lib/chef-sudo.rb +4 -3
- metadata +28 -53
data/{README.rdoc → README.md}
RENAMED
@@ -1,14 +1,37 @@
|
|
1
|
-
|
1
|
+
# chef sudo resource
|
2
2
|
|
3
3
|
A chef resource which allows executing commands with sudo.
|
4
4
|
|
5
|
-
|
5
|
+
|
6
|
+
## Installation
|
7
|
+
|
8
|
+
```
|
9
|
+
gem install chef-sudo
|
10
|
+
```
|
11
|
+
|
12
|
+
## Usage in chef recipe
|
13
|
+
|
14
|
+
```ruby
|
15
|
+
require "chef-sudo"
|
16
|
+
|
17
|
+
sudo "Running sample command" do
|
18
|
+
command "ls -lahS"
|
19
|
+
cwd "/tmp"
|
20
|
+
user "kate"
|
21
|
+
group "users"
|
22
|
+
# sudo -i
|
23
|
+
simulate_initial_login true
|
24
|
+
end
|
25
|
+
|
26
|
+
```
|
27
|
+
|
28
|
+
## Compatibility
|
6
29
|
|
7
30
|
0.1.x gem version is compatible with chef 0.8.x
|
8
31
|
|
9
32
|
0.2.x gem version is compatible with chef 0.9.x
|
10
33
|
|
11
|
-
|
34
|
+
## Note on Patches/Pull Requests
|
12
35
|
|
13
36
|
* Fork the project.
|
14
37
|
* Make your feature addition or bug fix.
|
@@ -18,6 +41,6 @@ A chef resource which allows executing commands with sudo.
|
|
18
41
|
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
19
42
|
* Send me a pull request. Bonus points for topic branches.
|
20
43
|
|
21
|
-
|
44
|
+
## Copyright
|
22
45
|
|
23
|
-
Copyright (c)
|
46
|
+
Copyright (c) 2012 Mariusz Pietrzyk wijet at wijet dot pl. See LICENSE for details.
|
data/chef-sudo.gemspec
CHANGED
data/lib/chef-sudo.rb
CHANGED
@@ -72,11 +72,12 @@ class Chef
|
|
72
72
|
command << "-u #{@new_resource.user}" if @new_resource.user
|
73
73
|
command << "-g #{@new_resource.group}" if @new_resource.group
|
74
74
|
command << "-i" if @new_resource.simulate_initial_login
|
75
|
-
|
75
|
+
|
76
|
+
# changed " to ' to support `command`
|
76
77
|
if @new_resource.cwd
|
77
|
-
command << %Q{ bash -c
|
78
|
+
command << %Q{ bash -c 'cd #{@new_resource.cwd} && #{@new_resource.command}'}
|
78
79
|
else
|
79
|
-
command << %Q{ bash -c
|
80
|
+
command << %Q{ bash -c '#{@new_resource.command}'}
|
80
81
|
end
|
81
82
|
|
82
83
|
options = {:command => command.join(' ')}
|
metadata
CHANGED
@@ -1,91 +1,66 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef-sudo
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.4
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 2
|
9
|
-
- 3
|
10
|
-
version: 0.2.3
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Mariusz Pietrzyk
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-02-22 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: chef
|
22
|
-
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &70265416283500 !ruby/object:Gem::Requirement
|
24
17
|
none: false
|
25
|
-
requirements:
|
26
|
-
- -
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
hash: 59
|
29
|
-
segments:
|
30
|
-
- 0
|
31
|
-
- 9
|
32
|
-
- 0
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
33
21
|
version: 0.9.0
|
34
22
|
type: :runtime
|
35
|
-
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *70265416283500
|
36
25
|
description: Provides chef sudo resource for executing commands with sudo
|
37
|
-
email:
|
26
|
+
email:
|
38
27
|
- wijet@wijet.pl
|
39
28
|
executables: []
|
40
|
-
|
41
29
|
extensions: []
|
42
|
-
|
43
30
|
extra_rdoc_files: []
|
44
|
-
|
45
|
-
files:
|
31
|
+
files:
|
46
32
|
- .gitignore
|
47
33
|
- Gemfile
|
48
34
|
- Gemfile.lock
|
49
35
|
- LICENSE
|
50
|
-
- README.
|
36
|
+
- README.md
|
51
37
|
- Rakefile
|
52
38
|
- chef-sudo.gemspec
|
53
39
|
- lib/chef-sudo.rb
|
54
40
|
- test/helper.rb
|
55
41
|
homepage: http://github.com/wijet/chef-sudo
|
56
42
|
licenses: []
|
57
|
-
|
58
43
|
post_install_message:
|
59
44
|
rdoc_options: []
|
60
|
-
|
61
|
-
require_paths:
|
45
|
+
require_paths:
|
62
46
|
- lib
|
63
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
47
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
64
48
|
none: false
|
65
|
-
requirements:
|
66
|
-
- -
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
|
69
|
-
|
70
|
-
- 0
|
71
|
-
version: "0"
|
72
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
49
|
+
requirements:
|
50
|
+
- - ! '>='
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '0'
|
53
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
73
54
|
none: false
|
74
|
-
requirements:
|
75
|
-
- -
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
hash: 23
|
78
|
-
segments:
|
79
|
-
- 1
|
80
|
-
- 3
|
81
|
-
- 6
|
55
|
+
requirements:
|
56
|
+
- - ! '>='
|
57
|
+
- !ruby/object:Gem::Version
|
82
58
|
version: 1.3.6
|
83
59
|
requirements: []
|
84
|
-
|
85
60
|
rubyforge_project: chef-sudo
|
86
|
-
rubygems_version: 1.8.
|
61
|
+
rubygems_version: 1.8.15
|
87
62
|
signing_key:
|
88
63
|
specification_version: 3
|
89
64
|
summary: chef sudo resource
|
90
65
|
test_files: []
|
91
|
-
|
66
|
+
has_rdoc:
|