kitchen-encrypt-databags 0.1.1 → 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 +5 -5
- data/lib/kitchen/provisioner/chef_zero_encrypt_databags.rb +4 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 8719503199104bf36bd7fb7d31e022df531e5d7a51e73e6fc33725324704add2
|
|
4
|
+
data.tar.gz: a0d1a8600999ce454ce392fce187a95266a9434215587fd256816cfe3a26c1b3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e52a53d1e64ab35f111491489b14ba2c52502333c9cd65258e9745c17616ea341cb320a18be9c8d59bc2fd93b7e1c0f1f64f06dc39129719e5befec15fb46ca8
|
|
7
|
+
data.tar.gz: ce61d31eb265d89908d636cb32b6d29f741565f0da9e8d6446e0ab8071291960bcf1f072ffaab9d8b636a89a1188d67e98c18fb891e79a43da9bcbfb83e50f71
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "erb"
|
|
2
4
|
require "kitchen"
|
|
3
5
|
require "kitchen/provisioner/chef_zero"
|
|
4
6
|
require "chef/encrypted_data_bag_item"
|
|
@@ -43,7 +45,8 @@ module Kitchen
|
|
|
43
45
|
end
|
|
44
46
|
|
|
45
47
|
def encrypt_data_bag(data_bag_path, secret_key)
|
|
46
|
-
|
|
48
|
+
data_bag_content = ERB.new(File.read(data_bag_path)).result
|
|
49
|
+
data_bag = JSON.parse(data_bag_content)
|
|
47
50
|
::Chef::EncryptedDataBagItem.encrypt_data_bag_item(data_bag, secret_key)
|
|
48
51
|
rescue StandardError => err
|
|
49
52
|
raise DataBagEncryptionException, <<-MSG
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kitchen-encrypt-databags
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Lawrence Jones
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2018-06-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: chef
|
|
@@ -66,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
66
66
|
version: '0'
|
|
67
67
|
requirements: []
|
|
68
68
|
rubyforge_project:
|
|
69
|
-
rubygems_version: 2.6
|
|
69
|
+
rubygems_version: 2.7.6
|
|
70
70
|
signing_key:
|
|
71
71
|
specification_version: 4
|
|
72
72
|
summary: automatically encrypt databags when provisioning sandbox
|