knife-crawl 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +9 -1
- data/knife-crawl.gemspec +18 -0
- data/lib/chef/knife/crawl.rb +26 -0
- data/lib/knife-crawl/version.rb +1 -1
- metadata +24 -43
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 8f8c76fca5711e08989e422d7a02cf3ec1f08db6
|
4
|
+
data.tar.gz: 319d92b45f67034f860e57b7ddf962388ac07c08
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 7f7489b427578b71e25c33f76df1f6242df0038582fbc920d3b3a623c939de52251ee8c82835d08d92c37f041df577b4b8484283bfb3dc6fc96aa436be5645c6
|
7
|
+
data.tar.gz: 723ee33fdfb1a157f2b8468f606e889a3a4aeedd2c1832233b8fbff6bf9d8e52bcba6282ec37c5a17c94f1df9db83e56f7ef9698afbcbd5b0168429dc5b7f05a
|
data/README.md
CHANGED
@@ -19,4 +19,12 @@ VMDevStack is included in the following roles:
|
|
19
19
|
|
20
20
|
## Installation
|
21
21
|
|
22
|
-
|
22
|
+
#### Script install
|
23
|
+
|
24
|
+
Copy the knife-crawl script from lib/chef/knife/crawl.rb to your ~/.chef/plugins/knife directory.
|
25
|
+
|
26
|
+
#### Gem install
|
27
|
+
|
28
|
+
knife-crawl is available on rubygems.org - if you have that source in your gemrc, you can simply use:
|
29
|
+
|
30
|
+
gem install knife-crawl
|
data/knife-crawl.gemspec
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "knife-crawl/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = 'knife-crawl'
|
7
|
+
s.version = Knife::Crawl::VERSION
|
8
|
+
s.date = '2012-01-02'
|
9
|
+
s.summary = "A plugin for Chef::Knife which displays the roles that are included recursively within a role and optionally displays all the roles that include it."
|
10
|
+
s.description = s.summary
|
11
|
+
s.authors = ["John Goulah"]
|
12
|
+
s.email = ["jgoulah@gmail.com"]
|
13
|
+
s.homepage = "https://github.com/jgoulah/knife-crawl"
|
14
|
+
s.files = `git ls-files`.split("\n")
|
15
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
16
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
17
|
+
s.require_paths = ["lib"]
|
18
|
+
end
|
data/lib/chef/knife/crawl.rb
CHANGED
@@ -38,6 +38,25 @@ module GoulahKnifePlugins
|
|
38
38
|
:default => false,
|
39
39
|
:description => "Find the roles this role is included in"
|
40
40
|
|
41
|
+
option :expand,
|
42
|
+
:short => '-x',
|
43
|
+
:long => '--expand',
|
44
|
+
:boolean => true,
|
45
|
+
:default => false,
|
46
|
+
:description => "Expand the recipe list for each role"
|
47
|
+
|
48
|
+
option :environment,
|
49
|
+
:short => "-e ENVIRONMENT",
|
50
|
+
:long => "--environment ENVIRONMENT",
|
51
|
+
:description => "The environemnt to use for run_list expansion",
|
52
|
+
:default => "production"
|
53
|
+
|
54
|
+
option :data_source,
|
55
|
+
:short => "-d DATA_SOURCE",
|
56
|
+
:long => "--data-source DATA_SOURCE",
|
57
|
+
:description => "The data source to use (server/disk)",
|
58
|
+
:default => "server"
|
59
|
+
|
41
60
|
def run
|
42
61
|
unless name_args.size == 1
|
43
62
|
puts "You need to supply a role"
|
@@ -93,6 +112,13 @@ module GoulahKnifePlugins
|
|
93
112
|
|
94
113
|
loop_run_list role do |item|
|
95
114
|
output " * " + item.name
|
115
|
+
|
116
|
+
if config[:expand]
|
117
|
+
runlist = Chef::RunList.new
|
118
|
+
runlist.add("role[#{item.name}]")
|
119
|
+
expanded = runlist.expand(config[:environment],config[:data_source]).recipes
|
120
|
+
output " - " + expanded.inspect
|
121
|
+
end
|
96
122
|
crawl_role(item.name)
|
97
123
|
end
|
98
124
|
|
data/lib/knife-crawl/version.rb
CHANGED
metadata
CHANGED
@@ -1,68 +1,49 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: knife-crawl
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 0
|
9
|
-
- 1
|
10
|
-
version: 0.0.1
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
6
|
+
authors:
|
13
7
|
- John Goulah
|
14
8
|
autorequire:
|
15
9
|
bindir: bin
|
16
10
|
cert_chain: []
|
17
|
-
|
18
|
-
date: 2012-01-02 00:00:00 Z
|
11
|
+
date: 2012-01-02 00:00:00.000000000 Z
|
19
12
|
dependencies: []
|
20
|
-
|
21
|
-
|
22
|
-
email:
|
13
|
+
description: A plugin for Chef::Knife which displays the roles that are included recursively
|
14
|
+
within a role and optionally displays all the roles that include it.
|
15
|
+
email:
|
23
16
|
- jgoulah@gmail.com
|
24
17
|
executables: []
|
25
|
-
|
26
18
|
extensions: []
|
27
|
-
|
28
19
|
extra_rdoc_files: []
|
29
|
-
|
30
|
-
files:
|
20
|
+
files:
|
31
21
|
- README.md
|
22
|
+
- knife-crawl.gemspec
|
32
23
|
- lib/chef/knife/crawl.rb
|
33
24
|
- lib/knife-crawl/version.rb
|
34
25
|
homepage: https://github.com/jgoulah/knife-crawl
|
35
26
|
licenses: []
|
36
|
-
|
27
|
+
metadata: {}
|
37
28
|
post_install_message:
|
38
29
|
rdoc_options: []
|
39
|
-
|
40
|
-
require_paths:
|
30
|
+
require_paths:
|
41
31
|
- lib
|
42
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
43
|
-
|
44
|
-
requirements:
|
32
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
33
|
+
requirements:
|
45
34
|
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
version: "0"
|
51
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
52
|
-
none: false
|
53
|
-
requirements:
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '0'
|
37
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
54
39
|
- - ">="
|
55
|
-
- !ruby/object:Gem::Version
|
56
|
-
|
57
|
-
segments:
|
58
|
-
- 0
|
59
|
-
version: "0"
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
60
42
|
requirements: []
|
61
|
-
|
62
43
|
rubyforge_project:
|
63
|
-
rubygems_version:
|
44
|
+
rubygems_version: 2.6.11
|
64
45
|
signing_key:
|
65
|
-
specification_version:
|
66
|
-
summary: A plugin for Chef::Knife which displays the roles that are included recursively
|
46
|
+
specification_version: 4
|
47
|
+
summary: A plugin for Chef::Knife which displays the roles that are included recursively
|
48
|
+
within a role and optionally displays all the roles that include it.
|
67
49
|
test_files: []
|
68
|
-
|