chef-fork 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/fork +0 -5
- data/lib/chef/fork/commands/bootstrap.rb +5 -4
- data/lib/chef/fork/commands/cookbook.rb +5 -4
- data/lib/chef/fork/commands/data.rb +7 -6
- data/lib/chef/fork/commands/databag.rb +2 -30
- data/lib/chef/fork/commands/environment.rb +6 -5
- data/lib/chef/fork/commands/role.rb +5 -4
- data/lib/chef/fork/commands/ssh.rb +3 -2
- data/lib/chef/fork/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff9a6a1e5886c238b2375110fc72f34624bded15
|
4
|
+
data.tar.gz: 34d6aaf1a3c65f92da6ec7190688d1abe7209c7f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e42f96c88b4d3d13fda2e55d96f79791b18116cdfd2cd70bc35095e0f126a794c9abf53d4ffdc242899465d9adbb09fd75fbe9ee2b45931e954310b627a3ca08
|
7
|
+
data.tar.gz: 12dc3fee80a97cbf77e6c09c5d084976cc0119e4fe7fc7e1ad511f5c24ff563193a3b55b189099ef6ea5b9c32b544b2e540c6713671b223de54d9ef25d02f600
|
data/bin/fork
CHANGED
@@ -1,9 +1,4 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
$LOAD_PATH.unshift(File.expand_path("../../lib", __FILE__))
|
3
|
-
|
4
|
-
# bundler/setup doesn't work expectedly when installed via gem
|
5
|
-
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __FILE__)
|
6
|
-
require "bundler/setup"
|
7
|
-
|
8
3
|
require "chef/fork"
|
9
4
|
Chef::Fork.new.main(ARGV.dup)
|
@@ -13,10 +13,11 @@ class Chef
|
|
13
13
|
module Commands
|
14
14
|
class Bootstrap < Ssh
|
15
15
|
def run(args=[])
|
16
|
-
rest = optparse.
|
17
|
-
hostname = rest.shift
|
18
|
-
|
19
|
-
|
16
|
+
rest = optparse.parse(args)
|
17
|
+
if hostname = rest.shift
|
18
|
+
command = bootstrap_command()
|
19
|
+
ssh(hostname, [command])
|
20
|
+
end
|
20
21
|
end
|
21
22
|
|
22
23
|
private
|
@@ -8,13 +8,14 @@ class Chef
|
|
8
8
|
module Commands
|
9
9
|
class Cookbook < Noop
|
10
10
|
def run(args=[])
|
11
|
-
|
11
|
+
rest = optparse.order(args)
|
12
|
+
case rest.first
|
12
13
|
when "show"
|
13
|
-
cookbook_show(
|
14
|
+
cookbook_show(rest.slice(1..-1) || [])
|
14
15
|
when "upload"
|
15
|
-
cookbook_upload(
|
16
|
+
cookbook_upload(rest.slice(1..-1) || [])
|
16
17
|
else
|
17
|
-
raise(NameError.new(
|
18
|
+
raise(NameError.new(rest.inspect))
|
18
19
|
end
|
19
20
|
end
|
20
21
|
|
@@ -8,11 +8,12 @@ class Chef
|
|
8
8
|
module Commands
|
9
9
|
class Data < Noop
|
10
10
|
def run(args=[])
|
11
|
-
|
11
|
+
rest = optparse.order(args)
|
12
|
+
case rest.first
|
12
13
|
when "bag"
|
13
|
-
data_bag(
|
14
|
+
data_bag(rest.slice(1..-1) || [])
|
14
15
|
else
|
15
|
-
raise(NameError.new(
|
16
|
+
raise(NameError.new(rest.inspect))
|
16
17
|
end
|
17
18
|
end
|
18
19
|
|
@@ -20,9 +21,9 @@ class Chef
|
|
20
21
|
def data_bag(args=[])
|
21
22
|
case args.first
|
22
23
|
when "from"
|
23
|
-
data_bag_from(args.slice(1..-1))
|
24
|
+
data_bag_from(args.slice(1..-1) || [])
|
24
25
|
when "show"
|
25
|
-
data_bag_show(args.slice(1..-1))
|
26
|
+
data_bag_show(args.slice(1..-1) || [])
|
26
27
|
else
|
27
28
|
raise(NameError.new(args.inspect))
|
28
29
|
end
|
@@ -31,7 +32,7 @@ class Chef
|
|
31
32
|
def data_bag_from(args=[])
|
32
33
|
case args.first
|
33
34
|
when "file"
|
34
|
-
data_bag_from_file(args.slice(1..-1))
|
35
|
+
data_bag_from_file(args.slice(1..-1) || [])
|
35
36
|
else
|
36
37
|
raise(NameError.new(args.inspect))
|
37
38
|
end
|
@@ -8,36 +8,8 @@ class Chef
|
|
8
8
|
module Commands
|
9
9
|
class Databag < Data
|
10
10
|
def run(args=[])
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
private
|
15
|
-
def data_bag(args=[])
|
16
|
-
case args.first
|
17
|
-
when "from"
|
18
|
-
data_bag_from(args.slice(1..-1))
|
19
|
-
when "show"
|
20
|
-
data_bag_show(args.slice(1..-1))
|
21
|
-
else
|
22
|
-
raise(NameError.new(args.inspect))
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
def data_bag_from(args=[])
|
27
|
-
case args.first
|
28
|
-
when "file"
|
29
|
-
data_bag_from_file(args.slice(1..-1))
|
30
|
-
else
|
31
|
-
raise(NameError.new(args.inspect))
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
def data_bag_from_file(args=[])
|
36
|
-
raise(NotImplementedError.new(args.inspect))
|
37
|
-
end
|
38
|
-
|
39
|
-
def data_bag_show(args=[])
|
40
|
-
raise(NotImplementedError.new(args.inspect))
|
11
|
+
rest = optparse.order(args)
|
12
|
+
data_bag(rest)
|
41
13
|
end
|
42
14
|
end
|
43
15
|
end
|
@@ -8,13 +8,14 @@ class Chef
|
|
8
8
|
module Commands
|
9
9
|
class Environment < Noop
|
10
10
|
def run(args=[])
|
11
|
-
|
11
|
+
rest = optparse.order(args)
|
12
|
+
case rest.first
|
12
13
|
when "from"
|
13
|
-
environment_from(
|
14
|
+
environment_from(rest.slice(1..-1) || [])
|
14
15
|
when "show"
|
15
|
-
environment_show(
|
16
|
+
environment_show(rest.slice(1..-1) || [])
|
16
17
|
else
|
17
|
-
raise(NameError.new(
|
18
|
+
raise(NameError.new(rest.inspect))
|
18
19
|
end
|
19
20
|
end
|
20
21
|
|
@@ -22,7 +23,7 @@ class Chef
|
|
22
23
|
def environment_from(args=[])
|
23
24
|
case args.first
|
24
25
|
when "file"
|
25
|
-
environment_from_file(args.slice(1..-1))
|
26
|
+
environment_from_file(args.slice(1..-1) || [])
|
26
27
|
else
|
27
28
|
raise(NameError.new(args.inspect))
|
28
29
|
end
|
@@ -8,13 +8,14 @@ class Chef
|
|
8
8
|
module Commands
|
9
9
|
class Role < Noop
|
10
10
|
def run(args=[])
|
11
|
-
|
11
|
+
rest = optparse.order(args)
|
12
|
+
case rest.first
|
12
13
|
when "from"
|
13
|
-
role_from(
|
14
|
+
role_from(rest.slice(1..-1) || [])
|
14
15
|
when "show"
|
15
|
-
role_show(
|
16
|
+
role_show(rest.slice(1..-1) || [])
|
16
17
|
else
|
17
|
-
raise(NameError.new(
|
18
|
+
raise(NameError.new(rest.inspect))
|
18
19
|
end
|
19
20
|
end
|
20
21
|
|
data/lib/chef/fork/version.rb
CHANGED