toque 1.1.0 → 1.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/toque/chef.rb +10 -1
- data/lib/toque/version.rb +1 -1
- data/spec/toque/chef_spec.rb +26 -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: abe45ec2e232621d391e863a00de26f9687c2efe
|
4
|
+
data.tar.gz: 20dcc17fcf3005f8f7ed944213ba5a2cb34abe9f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fec190cf7bea20de7c050792ff0f2897344e3d39b2818605ec28d16ee866cf88f321f586816e20c4f6758ba00437c235631fa5dba7dc6a07f6ced9d3362980e8
|
7
|
+
data.tar.gz: 0ba3906f360398bccc02ddd76902a9881204e50cd4ab5c5dabf42a23480c244ecb14aafcff0c69518d0bb892a8ffe095cf6ebd1b7a5fc9c9863a369adabec6a0
|
data/lib/toque/chef.rb
CHANGED
@@ -117,10 +117,19 @@ module Toque
|
|
117
117
|
task :configuration do
|
118
118
|
pwd!
|
119
119
|
|
120
|
-
attrs = variables.dup
|
120
|
+
attrs = convert variables.dup
|
121
121
|
attrs[:run_list] = recipes
|
122
122
|
put MultiJson.dump(attrs), pwd("node.json"), :via => :scp
|
123
123
|
end
|
124
|
+
|
125
|
+
def convert(hash)
|
126
|
+
hash.inject({}) do |h, e|
|
127
|
+
key, value = *e
|
128
|
+
h[key] = convert value if value.is_a?(Hash)
|
129
|
+
h[key] = value.call if value.is_a?(Proc)
|
130
|
+
h
|
131
|
+
end
|
132
|
+
end
|
124
133
|
end
|
125
134
|
|
126
135
|
desc 'Run list of recipes from `:run_list` option.'
|
data/lib/toque/version.rb
CHANGED
data/spec/toque/chef_spec.rb
CHANGED
@@ -76,7 +76,7 @@ describe Toque::Chef, 'loaded into capistrano' do
|
|
76
76
|
end
|
77
77
|
end
|
78
78
|
|
79
|
-
describe '
|
79
|
+
describe 'toque:chef:setup:cookbooks' do
|
80
80
|
before do
|
81
81
|
File.stub(:exists?).and_return false
|
82
82
|
File.stub(:exists?).with('config/cookbooks').and_return true
|
@@ -101,6 +101,31 @@ describe Toque::Chef, 'loaded into capistrano' do
|
|
101
101
|
end
|
102
102
|
end
|
103
103
|
|
104
|
+
describe 'toque:chef:setup:script' do
|
105
|
+
it 'should upload chef solo script' do
|
106
|
+
@configuration.toque.chef.setup.script
|
107
|
+
|
108
|
+
expect(@configuration).to have_uploaded.to('/tmp/toque/node.rb')
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
describe 'toque:chef:setup:configuration' do
|
113
|
+
before do
|
114
|
+
@configuration.set :run_list, %w(recipe[awesomeium])
|
115
|
+
@configuration.set :postgres, :version => '9.2', password: -> { { postgresql: 'secret_in_proc' } }
|
116
|
+
@configuration.toque.chef.setup.configuration
|
117
|
+
@node = MultiJson.load @configuration.uploads.keys.first.read
|
118
|
+
end
|
119
|
+
|
120
|
+
it 'should upload node configuration' do
|
121
|
+
expect(@configuration).to have_uploaded.to('/tmp/toque/node.json')
|
122
|
+
end
|
123
|
+
|
124
|
+
it 'should have called option procs' do
|
125
|
+
expect(@node['postgres']['password']).to be == { 'postgresql' => 'secret_in_proc' }
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
104
129
|
describe 'toque:chef:install' do
|
105
130
|
|
106
131
|
it 'should install chef using omnibus installer' do
|