chef-fork 0.1.4 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/chef/fork/bootstrap/context.rb +13 -0
- data/lib/chef/fork/commands/bootstrap.rb +21 -2
- data/lib/chef/fork/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe0eeb08f02296252609611b83e26234f5e7f138
|
4
|
+
data.tar.gz: d6031a3748bc8f28e83286d918a960f0578d6f9b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f76363e0b5a9d7d674418d42de7d1af0c0b60b3b807cc5693779e78ccaa57676dd723a23ad68dc5e2673db17bcfbfbee7b690be94296c59717612a9242768cc
|
7
|
+
data.tar.gz: 46609e2da25c04ae096a2adc73c26767e26176a612be4c9fa88df96bdb24bc6e1684bb9fe5be3aaa1ed36cd9a42be229cc720ae8ed955bb5920ddecfe2366742
|
@@ -3,10 +3,11 @@
|
|
3
3
|
|
4
4
|
require "chef"
|
5
5
|
require "chef/config"
|
6
|
-
require "chef/
|
6
|
+
require "chef/encrypted_data_bag_item"
|
7
7
|
require "erubis"
|
8
8
|
require "json"
|
9
9
|
require "shellwords"
|
10
|
+
require "chef/fork/bootstrap/context"
|
10
11
|
require "chef/fork/commands/ssh"
|
11
12
|
|
12
13
|
class Chef
|
@@ -94,6 +95,8 @@ class Chef
|
|
94
95
|
def find_template(name)
|
95
96
|
templates = $LOAD_PATH.map { |path|
|
96
97
|
[
|
98
|
+
File.join(path, "chef", "fork", "bootstrap", "templates", "#{name}.erb"), # Chef 12.x
|
99
|
+
File.join(path, "chef", "fork", "bootstrap", "#{name}.erb"), # Chef 11.x
|
97
100
|
File.join(path, "chef", "knife", "bootstrap", "templates", "#{name}.erb"), # Chef 12.x
|
98
101
|
File.join(path, "chef", "knife", "bootstrap", "#{name}.erb"), # Chef 11.x
|
99
102
|
]
|
@@ -102,7 +105,23 @@ class Chef
|
|
102
105
|
end
|
103
106
|
|
104
107
|
def render_template(template)
|
105
|
-
|
108
|
+
case Chef::VERSION.split(".").first
|
109
|
+
when "11"
|
110
|
+
context = Chef::Fork::Bootstrap::Context.new(options, options[:run_list], Chef::Config)
|
111
|
+
else
|
112
|
+
if Chef::Config[:knife][:secret]
|
113
|
+
secret = Chef::Config[:knife][:secret]
|
114
|
+
else
|
115
|
+
if Chef::Config[:knife][:secret_file]
|
116
|
+
secret = Chef::EncryptedDataBagItem.load_secret(Chef::Config[:knife][:secret_file])
|
117
|
+
end
|
118
|
+
end
|
119
|
+
if secret
|
120
|
+
context = Chef::Fork::Bootstrap::Context.new(options, options[:run_list], Chef::Config, secret)
|
121
|
+
else
|
122
|
+
context = Chef::Fork::Bootstrap::Context.new(options, options[:run_list], Chef::Config)
|
123
|
+
end
|
124
|
+
end
|
106
125
|
Erubis::Eruby.new(template).evaluate(context)
|
107
126
|
end
|
108
127
|
end
|
data/lib/chef/fork/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef-fork
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yamashita Yuu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -85,6 +85,7 @@ files:
|
|
85
85
|
- knife-and-fork.md
|
86
86
|
- lib/chef/fork.rb
|
87
87
|
- lib/chef/fork/application.rb
|
88
|
+
- lib/chef/fork/bootstrap/context.rb
|
88
89
|
- lib/chef/fork/commands.rb
|
89
90
|
- lib/chef/fork/commands/bootstrap.rb
|
90
91
|
- lib/chef/fork/commands/cookbook.rb
|
@@ -116,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
117
|
version: '0'
|
117
118
|
requirements: []
|
118
119
|
rubyforge_project:
|
119
|
-
rubygems_version: 2.
|
120
|
+
rubygems_version: 2.5.1
|
120
121
|
signing_key:
|
121
122
|
specification_version: 4
|
122
123
|
summary: A tool for your left hand, to have a meal cooked by chef.
|