hiera-eyaml 4.3.0 → 5.0.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/.github/release.yml +41 -0
- data/.github/workflows/release.yml +91 -15
- data/.github/workflows/test.yml +22 -14
- data/CHANGELOG.md +24 -0
- data/Gemfile +10 -3
- data/README.md +4 -1
- data/hiera-eyaml.gemspec +2 -1
- data/lib/hiera/backend/eyaml/CLI.rb +1 -1
- data/lib/hiera/backend/eyaml/encryptors/pkcs7.rb +13 -3
- data/lib/hiera/backend/eyaml/highlinehelper.rb +7 -3
- data/lib/hiera/backend/eyaml/subcommand.rb +4 -0
- data/lib/hiera/backend/eyaml/subcommands/decrypt.rb +11 -0
- data/lib/hiera/backend/eyaml/subcommands/encrypt.rb +12 -0
- data/lib/hiera/backend/eyaml.rb +1 -1
- metadata +19 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 932c6b900a2840edbf57d44a00b39e31c337f6c76fd0161c47ed4d49b18463a8
|
|
4
|
+
data.tar.gz: 51ee6c0a95ebfc4bb9af94572451554d6a2390ade43c1b0c4a2f0f18f8df8d99
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 92a37b8e83aa2fcf0e483df040eafba7885d29f5b8179646ca1012f930776c336e4b1327704ff2ae6cf2b3cc0a67d5f432de81539b5698fd92986b05e934a516
|
|
7
|
+
data.tar.gz: 9d44c0788b1cc0eb6c838eefb8d2dd4f4d5a113207d96bdb4e2aef8f20b2a187842f3f5774c298f53e4db4e18dce8117dfe5db70ed2e0d5b7a0dd582470d479f
|
data/.github/release.yml
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
# https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes
|
|
3
|
+
|
|
4
|
+
changelog:
|
|
5
|
+
exclude:
|
|
6
|
+
labels:
|
|
7
|
+
- duplicate
|
|
8
|
+
- invalid
|
|
9
|
+
- modulesync
|
|
10
|
+
- question
|
|
11
|
+
- skip-changelog
|
|
12
|
+
- wont-fix
|
|
13
|
+
- wontfix
|
|
14
|
+
- github_actions
|
|
15
|
+
|
|
16
|
+
categories:
|
|
17
|
+
- title: Breaking Changes 🛠
|
|
18
|
+
labels:
|
|
19
|
+
- backwards-incompatible
|
|
20
|
+
|
|
21
|
+
- title: New Features 🎉
|
|
22
|
+
labels:
|
|
23
|
+
- enhancement
|
|
24
|
+
|
|
25
|
+
- title: Bug Fixes 🐛
|
|
26
|
+
labels:
|
|
27
|
+
- bug
|
|
28
|
+
- bugfix
|
|
29
|
+
|
|
30
|
+
- title: Documentation Updates 📚
|
|
31
|
+
labels:
|
|
32
|
+
- documentation
|
|
33
|
+
- docs
|
|
34
|
+
|
|
35
|
+
- title: Dependency Updates ⬆️
|
|
36
|
+
labels:
|
|
37
|
+
- dependencies
|
|
38
|
+
|
|
39
|
+
- title: Other Changes
|
|
40
|
+
labels:
|
|
41
|
+
- "*"
|
|
@@ -1,30 +1,106 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
name: Gem Release
|
|
2
3
|
|
|
3
4
|
on:
|
|
4
5
|
push:
|
|
5
6
|
tags:
|
|
6
7
|
- '*'
|
|
7
8
|
|
|
9
|
+
permissions: {}
|
|
10
|
+
|
|
8
11
|
jobs:
|
|
9
|
-
release:
|
|
10
|
-
|
|
12
|
+
build-release:
|
|
13
|
+
# Prevent releases from forked repositories
|
|
11
14
|
if: github.repository_owner == 'voxpupuli'
|
|
15
|
+
name: Build the gem
|
|
16
|
+
runs-on: ubuntu-24.04
|
|
12
17
|
steps:
|
|
13
|
-
- uses: actions/checkout@
|
|
14
|
-
- name: Install Ruby
|
|
18
|
+
- uses: actions/checkout@v6
|
|
19
|
+
- name: Install Ruby
|
|
15
20
|
uses: ruby/setup-ruby@v1
|
|
16
21
|
with:
|
|
17
|
-
ruby-version: '
|
|
22
|
+
ruby-version: 'ruby'
|
|
18
23
|
- name: Build gem
|
|
19
|
-
|
|
24
|
+
shell: bash
|
|
25
|
+
run: gem build --verbose *.gemspec
|
|
26
|
+
- name: Upload gem to GitHub cache
|
|
27
|
+
uses: actions/upload-artifact@v6
|
|
28
|
+
with:
|
|
29
|
+
name: gem-artifact
|
|
30
|
+
path: '*.gem'
|
|
31
|
+
retention-days: 1
|
|
32
|
+
compression-level: 0
|
|
33
|
+
|
|
34
|
+
create-github-release:
|
|
35
|
+
needs: build-release
|
|
36
|
+
name: Create GitHub release
|
|
37
|
+
runs-on: ubuntu-24.04
|
|
38
|
+
permissions:
|
|
39
|
+
contents: write # clone repo and create release
|
|
40
|
+
steps:
|
|
41
|
+
- name: Download gem from GitHub cache
|
|
42
|
+
uses: actions/download-artifact@v7
|
|
43
|
+
with:
|
|
44
|
+
name: gem-artifact
|
|
45
|
+
- name: Create Release
|
|
46
|
+
shell: bash
|
|
47
|
+
env:
|
|
48
|
+
GH_TOKEN: ${{ github.token }}
|
|
49
|
+
run: gh release create --repo ${{ github.repository }} ${{ github.ref_name }} --generate-notes *.gem
|
|
50
|
+
|
|
51
|
+
release-to-github:
|
|
52
|
+
needs: build-release
|
|
53
|
+
name: Release to GitHub
|
|
54
|
+
runs-on: ubuntu-24.04
|
|
55
|
+
permissions:
|
|
56
|
+
packages: write # publish to rubygems.pkg.github.com
|
|
57
|
+
steps:
|
|
58
|
+
- name: Download gem from GitHub cache
|
|
59
|
+
uses: actions/download-artifact@v7
|
|
60
|
+
with:
|
|
61
|
+
name: gem-artifact
|
|
62
|
+
- name: Publish gem to GitHub packages
|
|
63
|
+
run: gem push --host https://rubygems.pkg.github.com/${{ github.repository_owner }} *.gem
|
|
64
|
+
env:
|
|
65
|
+
GEM_HOST_API_KEY: ${{ secrets.GITHUB_TOKEN }}
|
|
66
|
+
|
|
67
|
+
release-to-rubygems:
|
|
68
|
+
needs: build-release
|
|
69
|
+
name: Release gem to rubygems.org
|
|
70
|
+
runs-on: ubuntu-24.04
|
|
71
|
+
environment: release # recommended by rubygems.org
|
|
72
|
+
permissions:
|
|
73
|
+
id-token: write # rubygems.org authentication
|
|
74
|
+
steps:
|
|
75
|
+
- name: Download gem from GitHub cache
|
|
76
|
+
uses: actions/download-artifact@v7
|
|
77
|
+
with:
|
|
78
|
+
name: gem-artifact
|
|
79
|
+
- uses: rubygems/configure-rubygems-credentials@v1.0.0
|
|
20
80
|
- name: Publish gem to rubygems.org
|
|
81
|
+
shell: bash
|
|
21
82
|
run: gem push *.gem
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
83
|
+
|
|
84
|
+
release-verification:
|
|
85
|
+
name: Check that all releases are done
|
|
86
|
+
runs-on: ubuntu-24.04
|
|
87
|
+
permissions:
|
|
88
|
+
contents: read # minimal permissions that we have to grant
|
|
89
|
+
needs:
|
|
90
|
+
- create-github-release
|
|
91
|
+
- release-to-github
|
|
92
|
+
- release-to-rubygems
|
|
93
|
+
steps:
|
|
94
|
+
- name: Download gem from GitHub cache
|
|
95
|
+
uses: actions/download-artifact@v7
|
|
96
|
+
with:
|
|
97
|
+
name: gem-artifact
|
|
98
|
+
- name: Install Ruby
|
|
99
|
+
uses: ruby/setup-ruby@v1
|
|
100
|
+
with:
|
|
101
|
+
ruby-version: 'ruby'
|
|
102
|
+
- name: Wait for release to propagate
|
|
103
|
+
shell: bash
|
|
25
104
|
run: |
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
chmod 0600 ~/.gem/credentials
|
|
29
|
-
- name: Publish gem to GitHub packages
|
|
30
|
-
run: gem push --key github --host https://rubygems.pkg.github.com/voxpupuli *.gem
|
|
105
|
+
gem install rubygems-await
|
|
106
|
+
gem await *.gem
|
data/.github/workflows/test.yml
CHANGED
|
@@ -7,8 +7,8 @@ on:
|
|
|
7
7
|
branches:
|
|
8
8
|
- master
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
12
|
|
|
13
13
|
jobs:
|
|
14
14
|
rubocop:
|
|
@@ -16,7 +16,7 @@ jobs:
|
|
|
16
16
|
BUNDLE_WITHOUT: release
|
|
17
17
|
runs-on: ubuntu-24.04
|
|
18
18
|
steps:
|
|
19
|
-
- uses: actions/checkout@
|
|
19
|
+
- uses: actions/checkout@v6
|
|
20
20
|
- name: Install Ruby ${{ matrix.ruby }}
|
|
21
21
|
uses: ruby/setup-ruby@v1
|
|
22
22
|
with:
|
|
@@ -35,22 +35,28 @@ jobs:
|
|
|
35
35
|
- "3.1"
|
|
36
36
|
- "3.2"
|
|
37
37
|
- "3.3"
|
|
38
|
+
- "3.4"
|
|
39
|
+
- "4.0"
|
|
38
40
|
- jruby-9.4
|
|
41
|
+
- jruby-10
|
|
39
42
|
openvox:
|
|
40
43
|
- "~> 8"
|
|
41
44
|
- "~> 7"
|
|
42
45
|
- "https://github.com/OpenVoxProject/puppet.git#main"
|
|
43
46
|
exclude:
|
|
47
|
+
- ruby: jruby-10
|
|
48
|
+
openvox: "~> 7"
|
|
49
|
+
- ruby: "4.0"
|
|
50
|
+
openvox: "~> 7"
|
|
51
|
+
|
|
52
|
+
- ruby: "3.4"
|
|
53
|
+
openvox: "~> 7"
|
|
54
|
+
|
|
44
55
|
- ruby: "3.0"
|
|
45
56
|
openvox: "~> 8"
|
|
46
57
|
- ruby: "2.7"
|
|
47
58
|
openvox: "~> 8"
|
|
48
59
|
|
|
49
|
-
- ruby: "3.0"
|
|
50
|
-
openvox: "https://github.com/openvoxlabs/puppet.git#main"
|
|
51
|
-
- ruby: "2.7"
|
|
52
|
-
openvox: "https://github.com/openvoxlabs/puppet.git#main"
|
|
53
|
-
|
|
54
60
|
- ruby: "3.0"
|
|
55
61
|
openvox: "https://github.com/openvoxproject/puppet.git#main"
|
|
56
62
|
- ruby: "2.7"
|
|
@@ -62,11 +68,9 @@ jobs:
|
|
|
62
68
|
name: "Ruby ${{ matrix.ruby }} - OpenVox ${{ matrix.openvox }}"
|
|
63
69
|
steps:
|
|
64
70
|
- name: Enable coverage reporting on Ruby 3.1
|
|
65
|
-
if: matrix.openvox == '~> 7
|
|
71
|
+
if: matrix.openvox == '~> 7' && matrix.ruby == '3.1'
|
|
66
72
|
run: echo 'COVERAGE=yes' >> $GITHUB_ENV
|
|
67
|
-
- uses: actions/checkout@
|
|
68
|
-
- name: Install expect
|
|
69
|
-
run: sudo apt-get install expect
|
|
73
|
+
- uses: actions/checkout@v6
|
|
70
74
|
- name: Install Ruby ${{ matrix.ruby }}
|
|
71
75
|
uses: ruby/setup-ruby@v1
|
|
72
76
|
with:
|
|
@@ -80,10 +84,14 @@ jobs:
|
|
|
80
84
|
run: gem build --strict --verbose *.gemspec
|
|
81
85
|
|
|
82
86
|
tests:
|
|
87
|
+
if: always()
|
|
83
88
|
needs:
|
|
84
89
|
- rubocop
|
|
85
90
|
- test
|
|
86
|
-
runs-on: ubuntu-
|
|
91
|
+
runs-on: ubuntu-24.04
|
|
87
92
|
name: Test suite
|
|
88
93
|
steps:
|
|
89
|
-
-
|
|
94
|
+
- name: Decide whether the needed jobs succeeded or failed
|
|
95
|
+
uses: re-actors/alls-green@release/v1
|
|
96
|
+
with:
|
|
97
|
+
jobs: ${{ toJSON(needs) }}
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [v5.0.0](https://github.com/voxpupuli/hiera-eyaml/tree/v5.0.0) (2026-02-21)
|
|
6
|
+
|
|
7
|
+
[Full Changelog](https://github.com/voxpupuli/hiera-eyaml/compare/v4.3.0...v5.0.0)
|
|
8
|
+
|
|
9
|
+
**Breaking changes:**
|
|
10
|
+
|
|
11
|
+
- adjust CLI newline printing to fix output not matching input [\#389](https://github.com/voxpupuli/hiera-eyaml/pull/389) ([bugfood](https://github.com/bugfood))
|
|
12
|
+
|
|
13
|
+
**Implemented enhancements:**
|
|
14
|
+
|
|
15
|
+
- syslog: Allow 0.4 [\#411](https://github.com/voxpupuli/hiera-eyaml/pull/411) ([bastelfreak](https://github.com/bastelfreak))
|
|
16
|
+
- Add Jruby-10 support [\#410](https://github.com/voxpupuli/hiera-eyaml/pull/410) ([bastelfreak](https://github.com/bastelfreak))
|
|
17
|
+
- Add Ruby 4.0 support [\#409](https://github.com/voxpupuli/hiera-eyaml/pull/409) ([bastelfreak](https://github.com/bastelfreak))
|
|
18
|
+
- feat\(\#404\): Accept base64 encoded environment variables as pkcs7 keys [\#405](https://github.com/voxpupuli/hiera-eyaml/pull/405) ([JGodin-C2C](https://github.com/JGodin-C2C))
|
|
19
|
+
- CI: Add Ruby 3.4 support [\#397](https://github.com/voxpupuli/hiera-eyaml/pull/397) ([bastelfreak](https://github.com/bastelfreak))
|
|
20
|
+
|
|
21
|
+
**Fixed bugs:**
|
|
22
|
+
|
|
23
|
+
- Trailing newline is added during encryption/decryption [\#272](https://github.com/voxpupuli/hiera-eyaml/issues/272)
|
|
24
|
+
|
|
25
|
+
**Merged pull requests:**
|
|
26
|
+
|
|
27
|
+
- README: mention that puppet-hiera can manage hiera-eyaml [\#399](https://github.com/voxpupuli/hiera-eyaml/pull/399) ([kenyon](https://github.com/kenyon))
|
|
28
|
+
|
|
5
29
|
## [v4.3.0](https://github.com/voxpupuli/hiera-eyaml/tree/v4.3.0) (2025-06-05)
|
|
6
30
|
|
|
7
31
|
[Full Changelog](https://github.com/voxpupuli/hiera-eyaml/compare/v4.2.0...v4.3.0)
|
data/Gemfile
CHANGED
|
@@ -24,12 +24,19 @@ group :development do
|
|
|
24
24
|
gem 'openvox', *location_for(ENV['OPENVOX_VERSION']) if ENV['OPENVOX_VERSION']
|
|
25
25
|
end
|
|
26
26
|
|
|
27
|
-
group :release do
|
|
28
|
-
gem 'faraday-retry', require: false
|
|
29
|
-
gem 'github_changelog_generator', require: false
|
|
27
|
+
group :release, optional: true do
|
|
28
|
+
gem 'faraday-retry', '~> 2.1', require: false
|
|
29
|
+
gem 'github_changelog_generator', '~> 1.16.4', require: false
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
group :coverage, optional: ENV['COVERAGE'] != 'yes' do
|
|
33
33
|
gem 'codecov', require: false
|
|
34
34
|
gem 'simplecov-console', require: false
|
|
35
35
|
end
|
|
36
|
+
|
|
37
|
+
# openvox gem depends on syslog, but doesn't list it as explicit dependency
|
|
38
|
+
# until Ruby 3.4, syslog was part of MRI ruby core
|
|
39
|
+
# https://github.com/OpenVoxProject/puppet/issues/90
|
|
40
|
+
platforms :mri do
|
|
41
|
+
gem 'syslog', '>= 0.3.0', '< 0.5'
|
|
42
|
+
end
|
data/README.md
CHANGED
|
@@ -65,6 +65,10 @@ files as simple as clear text files.
|
|
|
65
65
|
Setup
|
|
66
66
|
-----
|
|
67
67
|
|
|
68
|
+
### Puppet module
|
|
69
|
+
|
|
70
|
+
The Vox Pupuli [hiera module](https://github.com/voxpupuli/puppet-hiera) can manage the installation and configuration of hiera-eyaml.
|
|
71
|
+
|
|
68
72
|
### Installing hiera-eyaml
|
|
69
73
|
|
|
70
74
|
#### RubyGems
|
|
@@ -535,7 +539,6 @@ In order to run the tests, simply run `cucumber` in the top level directory of t
|
|
|
535
539
|
|
|
536
540
|
You'll need to have a few requirements installed:
|
|
537
541
|
|
|
538
|
-
* `expect` (via yum/apt-get or system package)
|
|
539
542
|
* `aruba` (gem)
|
|
540
543
|
* `cucumber` (gem)
|
|
541
544
|
* `puppet` (gem)
|
data/hiera-eyaml.gemspec
CHANGED
|
@@ -16,6 +16,7 @@ Gem::Specification.new do |gem|
|
|
|
16
16
|
gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
|
|
17
17
|
gem.require_paths = ['lib']
|
|
18
18
|
|
|
19
|
+
gem.add_dependency 'base64', '~> 0.3.0'
|
|
19
20
|
gem.add_dependency 'highline', '>= 2.1', '< 4'
|
|
20
21
|
gem.add_dependency 'optimist', '~> 3.1'
|
|
21
22
|
|
|
@@ -23,5 +24,5 @@ Gem::Specification.new do |gem|
|
|
|
23
24
|
gem.add_development_dependency 'rspec-expectations', '~> 3.13'
|
|
24
25
|
gem.add_development_dependency 'voxpupuli-rubocop', '~> 3.1.0'
|
|
25
26
|
|
|
26
|
-
gem.required_ruby_version = '>= 2.7', ' <
|
|
27
|
+
gem.required_ruby_version = '>= 2.7', ' < 5'
|
|
27
28
|
end
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
require 'openssl'
|
|
2
|
+
require 'base64'
|
|
2
3
|
require 'hiera/backend/eyaml/encryptor'
|
|
3
4
|
require 'hiera/backend/eyaml/encrypthelper'
|
|
4
5
|
require 'hiera/backend/eyaml/logginghelper'
|
|
@@ -20,6 +21,10 @@ class Hiera
|
|
|
20
21
|
type: :string, },
|
|
21
22
|
public_key_env_var: { desc: 'Name of environment variable to read public key from',
|
|
22
23
|
type: :string, },
|
|
24
|
+
b64_private_key_env_var: { desc: 'Name of environment variable to read private key from, encoded in base64',
|
|
25
|
+
type: :string, },
|
|
26
|
+
b64_public_key_env_var: { desc: 'Name of environment variable to read public key from, encoded in base64',
|
|
27
|
+
type: :string, },
|
|
23
28
|
keysize: { desc: 'Key size used for encryption',
|
|
24
29
|
type: :integer,
|
|
25
30
|
default: 2048, },
|
|
@@ -91,9 +96,10 @@ class Hiera
|
|
|
91
96
|
LoggingHelper.info 'Keys created OK'
|
|
92
97
|
end
|
|
93
98
|
|
|
94
|
-
def self.load_ANY_key_pem(optname_key, optname_env_var)
|
|
99
|
+
def self.load_ANY_key_pem(optname_key, optname_env_var, b64_optname_env_var)
|
|
95
100
|
opt_key = option(optname_key.to_sym)
|
|
96
101
|
opt_key_env_var = option(optname_env_var.to_sym)
|
|
102
|
+
b64_opt_key_env_var = option(b64_optname_env_var.to_sym)
|
|
97
103
|
|
|
98
104
|
if opt_key and opt_key_env_var
|
|
99
105
|
warn "both #{optname_key} and #{optname_env_var} specified, using #{optname_env_var}"
|
|
@@ -103,6 +109,10 @@ class Hiera
|
|
|
103
109
|
raise StandardError, "env #{opt_key_env_var} is not set" unless ENV[opt_key_env_var]
|
|
104
110
|
|
|
105
111
|
opt_key_pem = ENV.fetch(opt_key_env_var, nil)
|
|
112
|
+
elsif b64_opt_key_env_var
|
|
113
|
+
raise StandardError, "env #{b64_opt_key_env_var} is not set" unless ENV[b64_opt_key_env_var]
|
|
114
|
+
|
|
115
|
+
opt_key_pem = Base64.decode64(ENV.fetch(b64_opt_key_env_var, nil))
|
|
106
116
|
elsif opt_key
|
|
107
117
|
raise StandardError, "file #{opt_key} does not exist" unless File.exist? opt_key
|
|
108
118
|
|
|
@@ -115,11 +125,11 @@ class Hiera
|
|
|
115
125
|
end
|
|
116
126
|
|
|
117
127
|
def self.load_public_key_pem
|
|
118
|
-
load_ANY_key_pem('public_key', 'public_key_env_var')
|
|
128
|
+
load_ANY_key_pem('public_key', 'public_key_env_var', 'b64_public_key_env_var')
|
|
119
129
|
end
|
|
120
130
|
|
|
121
131
|
def self.load_private_key_pem
|
|
122
|
-
load_ANY_key_pem('private_key', 'private_key_env_var')
|
|
132
|
+
load_ANY_key_pem('private_key', 'private_key_env_var', 'b64_private_key_env_var')
|
|
123
133
|
end
|
|
124
134
|
end
|
|
125
135
|
end
|
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
require 'highline
|
|
1
|
+
require 'highline'
|
|
2
2
|
|
|
3
3
|
class Hiera
|
|
4
4
|
module Backend
|
|
5
5
|
module Eyaml
|
|
6
6
|
class HighlineHelper
|
|
7
|
+
def self.cli
|
|
8
|
+
HighLine.new($stdin, $stderr)
|
|
9
|
+
end
|
|
10
|
+
|
|
7
11
|
def self.read_password
|
|
8
|
-
ask('Enter password: ') { |q| q.echo = '*' }
|
|
12
|
+
cli.ask('Enter password: ') { |q| q.echo = '*' }
|
|
9
13
|
end
|
|
10
14
|
|
|
11
15
|
def self.confirm?(message)
|
|
12
|
-
result = ask("#{message} (y/N): ")
|
|
16
|
+
result = cli.ask("#{message} (y/N): ")
|
|
13
17
|
%w[y yes].include?(result.downcase) || false
|
|
14
18
|
end
|
|
15
19
|
end
|
|
@@ -81,6 +81,17 @@ class Hiera
|
|
|
81
81
|
decrypted.join
|
|
82
82
|
end
|
|
83
83
|
end
|
|
84
|
+
|
|
85
|
+
def self.print_out(string)
|
|
86
|
+
case Eyaml::Options[:source]
|
|
87
|
+
when :eyaml
|
|
88
|
+
# Be sure the output ends with a newline, since YAML is a text format.
|
|
89
|
+
puts string
|
|
90
|
+
else
|
|
91
|
+
# Print the exact result.
|
|
92
|
+
print string
|
|
93
|
+
end
|
|
94
|
+
end
|
|
84
95
|
end
|
|
85
96
|
end
|
|
86
97
|
end
|
|
@@ -90,6 +90,18 @@ class Hiera
|
|
|
90
90
|
end
|
|
91
91
|
end
|
|
92
92
|
end
|
|
93
|
+
|
|
94
|
+
def self.print_out(string)
|
|
95
|
+
case Eyaml::Options[:output]
|
|
96
|
+
when 'string'
|
|
97
|
+
# Do not include a newline, so that 'eyaml decrypt' of the
|
|
98
|
+
# output returns the original input.
|
|
99
|
+
print string
|
|
100
|
+
else
|
|
101
|
+
# The output is a text file, so ensure there is a final newline.
|
|
102
|
+
puts string
|
|
103
|
+
end
|
|
104
|
+
end
|
|
93
105
|
end
|
|
94
106
|
end
|
|
95
107
|
end
|
data/lib/hiera/backend/eyaml.rb
CHANGED
metadata
CHANGED
|
@@ -1,15 +1,28 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hiera-eyaml
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 5.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Vox Pupuli
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: base64
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - "~>"
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: 0.3.0
|
|
19
|
+
type: :runtime
|
|
20
|
+
prerelease: false
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - "~>"
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: 0.3.0
|
|
13
26
|
- !ruby/object:Gem::Dependency
|
|
14
27
|
name: highline
|
|
15
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -100,6 +113,7 @@ extensions: []
|
|
|
100
113
|
extra_rdoc_files: []
|
|
101
114
|
files:
|
|
102
115
|
- ".github/dependabot.yml"
|
|
116
|
+
- ".github/release.yml"
|
|
103
117
|
- ".github/workflows/release.yml"
|
|
104
118
|
- ".github/workflows/test.yml"
|
|
105
119
|
- ".gitignore"
|
|
@@ -146,7 +160,6 @@ homepage: https://github.com/voxpupuli/hiera-eyaml/
|
|
|
146
160
|
licenses:
|
|
147
161
|
- MIT
|
|
148
162
|
metadata: {}
|
|
149
|
-
post_install_message:
|
|
150
163
|
rdoc_options: []
|
|
151
164
|
require_paths:
|
|
152
165
|
- lib
|
|
@@ -157,15 +170,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
157
170
|
version: '2.7'
|
|
158
171
|
- - "<"
|
|
159
172
|
- !ruby/object:Gem::Version
|
|
160
|
-
version: '
|
|
173
|
+
version: '5'
|
|
161
174
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
162
175
|
requirements:
|
|
163
176
|
- - ">="
|
|
164
177
|
- !ruby/object:Gem::Version
|
|
165
178
|
version: '0'
|
|
166
179
|
requirements: []
|
|
167
|
-
rubygems_version:
|
|
168
|
-
signing_key:
|
|
180
|
+
rubygems_version: 4.0.3
|
|
169
181
|
specification_version: 4
|
|
170
182
|
summary: OpenSSL Encryption backend for Hiera
|
|
171
183
|
test_files: []
|