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 +4 -4
- data/.kitchen.yml +13 -2
- data/CHANGELOG.md +4 -0
- data/README.md +5 -3
- data/lib/poise_hoist.rb +3 -2
- data/lib/poise_hoist/version.rb +1 -1
- data/test/integration/data_bags/data_bags_spec.rb +23 -0
- data/test/integration/data_bags_policy.rb +26 -0
- data/test/integration/default/default_spec.rb +1 -1
- data/test/integration/default_policy.rb +0 -2
- metadata +5 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 518418c390cdbf5b75dcddb83c1d6c8f82f30973
|
4
|
+
data.tar.gz: 031e61388626f606f34feda87fade78a3677d5b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf936d9d119dca4f120234eb54573474cfc05f4e655ed822d15846b44199ae1ecfb7e60abae65bb58a05cc1db10fa6064830b0df6264434c5d8f25bf11ceb14f
|
7
|
+
data.tar.gz: 0a7018c2f7e5b28c1f32bd412b158a5c4a1c89c425f11d2aad1f21f0099146f9927eb1c0a889fc34997a8585d005b0662b5e79cb11a1d616e377bc9b4e083942
|
data/.kitchen.yml
CHANGED
@@ -1,10 +1,21 @@
|
|
1
1
|
---
|
2
2
|
#<% require 'poise_boiler' %>
|
3
|
-
<%= PoiseBoiler.kitchen(platforms: 'ubuntu-
|
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
|
data/CHANGELOG.md
CHANGED
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 `
|
68
|
-
|
69
|
-
|
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.
|
data/lib/poise_hoist.rb
CHANGED
@@ -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
|
-
|
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
|
data/lib/poise_hoist/version.rb
CHANGED
@@ -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'
|
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.
|
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
|