poise-hoist 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3fb46295a34a27f0f93f96bb1d19347a1abf7702
4
- data.tar.gz: 6b408c0816b48407f2573eb27e5d2f54ecb03dcf
3
+ metadata.gz: 518418c390cdbf5b75dcddb83c1d6c8f82f30973
4
+ data.tar.gz: 031e61388626f606f34feda87fade78a3677d5b5
5
5
  SHA512:
6
- metadata.gz: f8278a692afba614124b282cddd22f17c5aaa7896dbf0321bde657fa6d03158c87094b7fc421483f89344c66349cee0569caf1d6e01bba288bcda639bb471e8c
7
- data.tar.gz: 42cad4e087ec0d89d6d780d9196998a0076d7765a489c21245751e7da7b512c4fae9c8f05948f630ec3ef66f3231fa0a9876c243637438629b0979b191952279
6
+ metadata.gz: bf936d9d119dca4f120234eb54573474cfc05f4e655ed822d15846b44199ae1ecfb7e60abae65bb58a05cc1db10fa6064830b0df6264434c5d8f25bf11ceb14f
7
+ data.tar.gz: 0a7018c2f7e5b28c1f32bd412b158a5c4a1c89c425f11d2aad1f21f0099146f9927eb1c0a889fc34997a8585d005b0662b5e79cb11a1d616e377bc9b4e083942
@@ -1,10 +1,21 @@
1
1
  ---
2
2
  #<% require 'poise_boiler' %>
3
- <%= PoiseBoiler.kitchen(platforms: 'ubuntu-14.04') %>
3
+ <%= PoiseBoiler.kitchen(platforms: 'ubuntu-16.04') %>
4
4
 
5
5
  provisioner:
6
6
  name: poise_policyfile_zero
7
- policyfile: test/integration/default_policy.rb
8
7
 
9
8
  verifier:
10
9
  name: inspec
10
+
11
+ suites:
12
+ - name: default
13
+ run_list:
14
+ - poise-hoist_test
15
+ provisioner:
16
+ policyfile: test/integration/default_policy.rb
17
+ - name: data_bags
18
+ run_list:
19
+ - poise-hoist_test
20
+ provisioner:
21
+ policyfile: test/integration/data_bags_policy.rb
@@ -1,5 +1,9 @@
1
1
  # Poise-Hoist Changelog
2
2
 
3
+ ## v1.2.1
4
+
5
+ * Fix a logic error if you aren't using the data bag support.
6
+
3
7
  ## v1.2.0
4
8
 
5
9
  * Support for reading attributes from data bags when configured via `node['poise-hoist']['data_bag']`.
data/README.md CHANGED
@@ -64,9 +64,11 @@ be disabled by setting `node['poise-hoist']['hoist_chef_environment'] = false`.
64
64
 
65
65
  ## Data Bag Attributes
66
66
 
67
- To pull in data from a data bag, set `node['poise-hoist']['data_bag']`, in your
68
- Policyfile or in a wrapper cookbook. It will look for an item in the specified
69
- data bag using the name of the node and then the name of policy group.
67
+ To pull in data from a data bag, set `default['poise-hoist']['data_bag'] = 'the name of the data bag'`
68
+ in your Policyfile. It will look for an item in the specified data bag using the
69
+ name of the node and then the name of policy group. You can use this in
70
+ combination with the normal group-level hoisting to have a different data bag
71
+ name for some policy groups.
70
72
 
71
73
  This can be useful in combination with attributes from the Policyfile to provide
72
74
  immediate overrides outside of the "compile and push" cycle of the policy system.
@@ -40,8 +40,9 @@ module PoiseHoist
40
40
  # Hoist away, mateys!
41
41
  Chef::Mixin::DeepMerge.hash_only_merge!(node.role_default, node.role_default[policy_group]) if node.role_default.include?(policy_group)
42
42
  Chef::Mixin::DeepMerge.hash_only_merge!(node.role_override, node.role_override[policy_group]) if node.role_override.include?(policy_group)
43
- # Grab from a data bag if one is configured.
44
- hoist_from_data_bag!(node, policy_group, node['poise-hoist']['data_bag']) if node['poise-hoist']['data_bag']
43
+ # Grab from a data bag if one is configured. Remember this might run very
44
+ # early on newer Chef versions, before attribute loading.
45
+ hoist_from_data_bag!(node, policy_group, node['poise-hoist']['data_bag']) if node['poise-hoist'] && node['poise-hoist']['data_bag']
45
46
  # Install the patch for chef_environment.
46
47
  patch_chef_environment!(node, policy_group)
47
48
  end
@@ -17,5 +17,5 @@
17
17
 
18
18
  module PoiseHoist
19
19
  # Version for the poise-hoist gem.
20
- VERSION = '1.2.0'
20
+ VERSION = '1.2.1'
21
21
  end
@@ -0,0 +1,23 @@
1
+ #
2
+ # Copyright 2016-2017, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ describe file('/hoist_test') do
18
+ its(:content) { is_expected.to eq '{"one":11,"two":222,"three":3,"four":44}' }
19
+ end
20
+
21
+ describe file('/hoist_environment') do
22
+ its(:content) { is_expected.to eq 'local' }
23
+ end
@@ -0,0 +1,26 @@
1
+ #
2
+ # Copyright 2016-2017, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ name 'default'
18
+ run_list 'poise-profiler', 'poise-hoist_test'
19
+
20
+ default['other']['hoist_test']['one'] = 100
21
+ default['local']['hoist_test']['one'] = 11
22
+ override['hoist_test']['two'] = 22
23
+ override['other']['hoist_test']['two'] = 220
24
+ override['local']['hoist_test']['two'] = 222
25
+
26
+ default['poise-hoist']['data_bag'] = 'hoist'
@@ -15,7 +15,7 @@
15
15
  #
16
16
 
17
17
  describe file('/hoist_test') do
18
- its(:content) { is_expected.to eq '{"one":11,"two":222,"three":3,"four":44}' }
18
+ its(:content) { is_expected.to eq '{"one":11,"two":222,"three":3,"four":4}' }
19
19
  end
20
20
 
21
21
  describe file('/hoist_environment') do
@@ -22,5 +22,3 @@ default['local']['hoist_test']['one'] = 11
22
22
  override['hoist_test']['two'] = 22
23
23
  override['other']['hoist_test']['two'] = 220
24
24
  override['local']['hoist_test']['two'] = 222
25
-
26
- default['poise-hoist']['data_bag'] = 'hoist'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: poise-hoist
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Noah Kantrowitz
@@ -142,7 +142,9 @@ files:
142
142
  - test/gemfiles/chef-13.0.gemfile
143
143
  - test/gemfiles/chef-13.gemfile
144
144
  - test/gemfiles/master.gemfile
145
+ - test/integration/data_bags/data_bags_spec.rb
145
146
  - test/integration/data_bags/hoist/local.json
147
+ - test/integration/data_bags_policy.rb
146
148
  - test/integration/default/default_spec.rb
147
149
  - test/integration/default_policy.rb
148
150
  - test/spec/fixtures/encrypted-node.json
@@ -204,7 +206,9 @@ test_files:
204
206
  - test/gemfiles/chef-13.0.gemfile
205
207
  - test/gemfiles/chef-13.gemfile
206
208
  - test/gemfiles/master.gemfile
209
+ - test/integration/data_bags/data_bags_spec.rb
207
210
  - test/integration/data_bags/hoist/local.json
211
+ - test/integration/data_bags_policy.rb
208
212
  - test/integration/default/default_spec.rb
209
213
  - test/integration/default_policy.rb
210
214
  - test/spec/fixtures/encrypted-node.json