hiera-eyaml 3.4.0 → 4.1.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/workflows/release.yml +2 -2
- data/.github/workflows/test.yml +18 -28
- data/.rubocop.yml +8 -0
- data/.rubocop_todo.yml +416 -0
- data/CHANGELOG.md +41 -1
- data/Gemfile +13 -14
- data/README.md +34 -10
- data/Rakefile +11 -4
- data/hiera-eyaml.gemspec +17 -15
- data/lib/hiera/backend/eyaml/CLI.rb +12 -19
- data/lib/hiera/backend/eyaml/commands.rb +2 -6
- data/lib/hiera/backend/eyaml/edithelper.rb +24 -19
- data/lib/hiera/backend/eyaml/encrypthelper.rb +17 -19
- data/lib/hiera/backend/eyaml/encryptor.rb +40 -43
- data/lib/hiera/backend/eyaml/encryptors/pkcs7.rb +81 -104
- data/lib/hiera/backend/eyaml/highlinehelper.rb +3 -5
- data/lib/hiera/backend/eyaml/logginghelper.rb +27 -29
- data/lib/hiera/backend/eyaml/options.rb +13 -16
- data/lib/hiera/backend/eyaml/parser/encrypted_tokens.rb +2 -2
- data/lib/hiera/backend/eyaml/parser/parser.rb +35 -36
- data/lib/hiera/backend/eyaml/parser/token.rb +15 -6
- data/lib/hiera/backend/eyaml/plugins.rb +13 -18
- data/lib/hiera/backend/eyaml/subcommand.rb +72 -74
- data/lib/hiera/backend/eyaml/subcommands/createkeys.rb +2 -6
- data/lib/hiera/backend/eyaml/subcommands/decrypt.rb +52 -52
- data/lib/hiera/backend/eyaml/subcommands/edit.rb +57 -58
- data/lib/hiera/backend/eyaml/subcommands/encrypt.rb +65 -69
- data/lib/hiera/backend/eyaml/subcommands/help.rb +17 -22
- data/lib/hiera/backend/eyaml/subcommands/recrypt.rb +13 -20
- data/lib/hiera/backend/eyaml/subcommands/unknown_command.rb +10 -14
- data/lib/hiera/backend/eyaml/subcommands/version.rb +4 -9
- data/lib/hiera/backend/eyaml/utils.rb +27 -28
- data/lib/hiera/backend/eyaml.rb +7 -9
- data/lib/hiera/backend/eyaml_backend.rb +33 -27
- metadata +62 -14
- data/tools/git_tag_release.rb +0 -98
- data/tools/regem.sh +0 -11
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Hiera eyaml
|
2
2
|
|
3
3
|
|
4
|
-
[](https://github.com/voxpupuli/hiera-eyaml/blob/master/LICENSE)
|
4
|
+
[](https://github.com/voxpupuli/hiera-eyaml/blob/master/LICENSE.txt)
|
5
5
|
[](https://github.com/voxpupuli/hiera-eyaml/actions/workflows/test.yml)
|
6
6
|
[](https://codecov.io/gh/voxpupuli/hiera-eyaml)
|
7
7
|
[](https://github.com/voxpupuli/hiera-eyaml/actions/workflows/release.yml)
|
@@ -12,7 +12,7 @@ hiera-eyaml is a backend for Hiera that provides per-value encryption of sensiti
|
|
12
12
|
to be used by Puppet.
|
13
13
|
|
14
14
|
-------------------------
|
15
|
-
:new: **hiera-eyaml is now part of
|
15
|
+
:new: **hiera-eyaml is now part of Vox Pupuli**
|
16
16
|
|
17
17
|
hiera-eyaml has a new home https://github.com/voxpupuli/hiera-eyaml.
|
18
18
|
|
@@ -35,7 +35,7 @@ Unlike `hiera-gpg`, `hiera-eyaml`:
|
|
35
35
|
easy as using clear text files)
|
36
36
|
- uses basic asymmetric encryption (PKCS#7) by default (doesn't require any native libraries that need to
|
37
37
|
be compiled & allows users without the private key to encrypt values that the puppet master can decrypt)
|
38
|
-
- has a pluggable encryption framework (e.g. GPG encryption ([hiera-eyaml-gpg](https://github.com/
|
38
|
+
- has a pluggable encryption framework (e.g. GPG encryption ([hiera-eyaml-gpg](https://github.com/voxpupuli/hiera-eyaml-gpg)) can be used
|
39
39
|
if you have the need for multiple keys and easier key rotation)
|
40
40
|
|
41
41
|
The Hiera eyaml backend uses yaml formatted files with the .eyaml extension. The encrypted strings are prefixed with the encryption
|
@@ -70,14 +70,34 @@ Setup
|
|
70
70
|
#### RubyGems
|
71
71
|
|
72
72
|
$ gem install hiera-eyaml
|
73
|
-
|
73
|
+
|
74
74
|
#### Apt (Ubuntu 18.04+)
|
75
75
|
|
76
76
|
$ sudo apt install hiera-eyaml
|
77
77
|
|
78
|
-
### Installing hiera-eyaml for
|
78
|
+
### Installing hiera-eyaml for [puppetserver](https://github.com/puppetlabs/puppetserver)
|
79
|
+
|
80
|
+
All commands need to be executed as root. Puppet Enterprise vendors hiera-eyaml
|
81
|
+
already, so you don't need to install it there.
|
82
|
+
|
83
|
+
```sh
|
84
|
+
puppetserver gem install hiera-eyaml
|
85
|
+
```
|
86
|
+
|
87
|
+
or via puppet:
|
79
88
|
|
80
|
-
|
89
|
+
```sh
|
90
|
+
puppet resource package hiera-eyaml ensure=installed provider=puppetserver_gem
|
91
|
+
```
|
92
|
+
|
93
|
+
or via Puppet DSL:
|
94
|
+
|
95
|
+
```puppet
|
96
|
+
package { 'hiera-eyaml':
|
97
|
+
ensure => 'installed',
|
98
|
+
provider => 'puppetserver_gem',
|
99
|
+
}
|
100
|
+
```
|
81
101
|
|
82
102
|
### Generate keys
|
83
103
|
|
@@ -123,9 +143,9 @@ Use the -l parameter to pass in a label for the encrypted value,
|
|
123
143
|
|
124
144
|
### Decryption
|
125
145
|
|
126
|
-
To decrypt something, you need the
|
146
|
+
To decrypt something, you need the private_key.
|
127
147
|
|
128
|
-
To test decryption you can
|
148
|
+
To test decryption you can use the eyaml tool
|
129
149
|
|
130
150
|
$ eyaml decrypt -f filename # Decrypt a file
|
131
151
|
$ eyaml decrypt -s 'ENC[PKCS7,.....]' # Decrypt a string
|
@@ -415,7 +435,11 @@ Configuration file for eyaml
|
|
415
435
|
|
416
436
|
Default parameters for the eyaml command line tool can be provided by creating a configuration YAML file.
|
417
437
|
|
418
|
-
Config files will be read
|
438
|
+
Config files will be read in following order:
|
439
|
+
* first from system-wide `/etc/eyaml/config.yaml`
|
440
|
+
* then from user home directory `~/.eyaml/config.yaml`
|
441
|
+
* then from current working directory `.eyaml/config.yaml`
|
442
|
+
* finally by anything referenced in the `EYAML_CONFIG` environment variable
|
419
443
|
|
420
444
|
The file takes any long form argument that you can provide on the command line. For example, to override the pkcs7 keys:
|
421
445
|
```yaml
|
@@ -499,7 +523,7 @@ Issues
|
|
499
523
|
|
500
524
|
If you have found a bug then please raise an issue here on github.
|
501
525
|
|
502
|
-
Some of us hang out on #
|
526
|
+
Some of us hang out on #voxpupuli on [Libera.Chat](https://libera.chat/), please drop by if you want to say hi or have a question.
|
503
527
|
|
504
528
|
|
505
529
|
Tests
|
data/Rakefile
CHANGED
@@ -21,24 +21,31 @@ else
|
|
21
21
|
SimpleCov::Formatter::Codecov,
|
22
22
|
]
|
23
23
|
end
|
24
|
-
require "bundler/gem_tasks"
|
25
24
|
|
26
25
|
# https://cucumber.io/docs/tools/ruby/
|
27
26
|
# https://stackoverflow.com/questions/6473419/using-simplecov-to-display-cucumber-code-coverage
|
28
27
|
require 'cucumber/rake/task'
|
29
28
|
Cucumber::Rake::Task.new(:features) do |t|
|
30
|
-
t.cucumber_opts =
|
29
|
+
t.cucumber_opts = %w[--format progress] # Any valid command line option can go here.
|
31
30
|
end
|
32
31
|
|
33
32
|
begin
|
34
33
|
require 'github_changelog_generator/task'
|
34
|
+
rescue LoadError
|
35
|
+
# Do nothing if no required gem installed
|
36
|
+
else
|
35
37
|
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
|
36
38
|
version = Hiera::Backend::Eyaml::VERSION
|
37
|
-
config.future_release = "v#{version}" if
|
39
|
+
config.future_release = "v#{version}" if /^\d+\.\d+.\d+$/.match?(version)
|
38
40
|
config.header = "# Changelog\n\nAll notable changes to this project will be documented in this file."
|
39
|
-
config.exclude_labels = %w
|
41
|
+
config.exclude_labels = %w[duplicate question invalid wontfix wont-fix skip-changelog github_actions]
|
40
42
|
config.user = 'voxpupuli'
|
41
43
|
config.project = 'hiera-eyaml'
|
42
44
|
end
|
45
|
+
end
|
46
|
+
|
47
|
+
begin
|
48
|
+
require 'voxpupuli/rubocop/rake'
|
43
49
|
rescue LoadError
|
50
|
+
# the voxpupuli-rubocop gem is optional
|
44
51
|
end
|
data/hiera-eyaml.gemspec
CHANGED
@@ -1,25 +1,27 @@
|
|
1
|
-
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
1
|
+
lib = File.expand_path('lib', __dir__)
|
3
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
3
|
require 'hiera/backend/eyaml'
|
5
4
|
|
6
5
|
Gem::Specification.new do |gem|
|
7
|
-
gem.name =
|
6
|
+
gem.name = 'hiera-eyaml'
|
8
7
|
gem.version = Hiera::Backend::Eyaml::VERSION
|
9
|
-
gem.description =
|
10
|
-
gem.summary =
|
11
|
-
gem.author =
|
12
|
-
gem.email =
|
13
|
-
gem.license =
|
8
|
+
gem.description = 'Hiera backend for decrypting encrypted yaml properties'
|
9
|
+
gem.summary = 'OpenSSL Encryption backend for Hiera'
|
10
|
+
gem.author = 'Vox Pupuli'
|
11
|
+
gem.email = 'voxpupuli@groups.io'
|
12
|
+
gem.license = 'MIT'
|
14
13
|
|
15
|
-
gem.homepage =
|
14
|
+
gem.homepage = 'https://github.com/voxpupuli/hiera-eyaml/'
|
16
15
|
gem.files = `git ls-files`.split($/).reject { |file| file =~ /^features.*$/ }
|
17
|
-
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
18
|
-
gem.
|
19
|
-
gem.require_paths = ["lib"]
|
16
|
+
gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
|
17
|
+
gem.require_paths = ['lib']
|
20
18
|
|
21
|
-
gem.
|
22
|
-
gem.
|
19
|
+
gem.add_runtime_dependency 'highline', '~> 2.1'
|
20
|
+
gem.add_runtime_dependency 'optimist', '~> 3.1'
|
23
21
|
|
24
|
-
gem.
|
22
|
+
gem.add_development_dependency 'rake', '~> 13.2', '>= 13.2.1'
|
23
|
+
gem.add_development_dependency 'rspec-expectations', '~> 3.13'
|
24
|
+
gem.add_development_dependency 'voxpupuli-rubocop', '2.6.0'
|
25
|
+
|
26
|
+
gem.required_ruby_version = '>= 2.7', ' < 4'
|
25
27
|
end
|
@@ -10,23 +10,23 @@ class Hiera
|
|
10
10
|
module Backend
|
11
11
|
module Eyaml
|
12
12
|
class CLI
|
13
|
-
|
14
13
|
def self.parse
|
15
|
-
|
16
14
|
Utils.require_dir 'hiera/backend/eyaml/subcommands'
|
17
|
-
Eyaml.subcommands = Utils.find_all_subclasses_of({ :
|
15
|
+
Eyaml.subcommands = Utils.find_all_subclasses_of({ parent_class: Hiera::Backend::Eyaml::Subcommands }).collect do |classname|
|
16
|
+
Utils.snakecase classname
|
17
|
+
end
|
18
18
|
|
19
19
|
Eyaml.subcommand = ARGV.shift
|
20
20
|
subcommand = case Eyaml.subcommand
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
21
|
+
when nil
|
22
|
+
ARGV.delete_if { true }
|
23
|
+
'unknown_command'
|
24
|
+
when /^-/
|
25
|
+
ARGV.delete_if { true }
|
26
|
+
'help'
|
27
|
+
else
|
28
|
+
Eyaml.subcommand
|
29
|
+
end
|
30
30
|
|
31
31
|
command_class = Subcommand.find subcommand
|
32
32
|
|
@@ -36,22 +36,15 @@ class Hiera
|
|
36
36
|
options = command_class.validate options
|
37
37
|
Eyaml::Options.set options
|
38
38
|
Eyaml::Options.trace
|
39
|
-
|
40
39
|
end
|
41
40
|
|
42
41
|
def self.execute
|
43
|
-
|
44
42
|
executor = Eyaml::Options[:executor]
|
45
43
|
|
46
44
|
result = executor.execute
|
47
45
|
puts result unless result.nil?
|
48
|
-
|
49
46
|
end
|
50
|
-
|
51
47
|
end
|
52
|
-
|
53
48
|
end
|
54
|
-
|
55
49
|
end
|
56
|
-
|
57
50
|
end
|
@@ -4,32 +4,38 @@ class Hiera
|
|
4
4
|
module Backend
|
5
5
|
module Eyaml
|
6
6
|
class EditHelper
|
7
|
-
|
8
7
|
def self.find_editor
|
9
|
-
editor = ENV
|
10
|
-
editor ||= %w
|
11
|
-
|
8
|
+
editor = ENV.fetch('EDITOR', nil)
|
9
|
+
editor ||= %w[/usr/bin/sensible-editor /usr/bin/editor /usr/bin/vim /usr/bin/vi].collect do |e|
|
10
|
+
e if FileTest.executable? e
|
11
|
+
end.compact.first
|
12
|
+
raise StandardError, 'Editor not found. Please set your EDITOR env variable' if editor.nil?
|
13
|
+
|
12
14
|
if editor.index(' ')
|
13
15
|
editor = editor.dup if editor.frozen? # values from ENV are frozen
|
14
|
-
editor.gsub!(/([^\\]|^)~/, '\1' + ENV
|
16
|
+
editor.gsub!(/([^\\]|^)~/, '\1' + ENV.fetch('HOME', nil)) # replace ~ with home unless escaped
|
15
17
|
editor.gsub!(/(^|[^\\])"/, '\1') # remove unescaped quotes during processing
|
16
|
-
editor.gsub!(
|
18
|
+
editor.gsub!('\\ ', ' ') # unescape spaces since we quote paths
|
17
19
|
pieces = editor.split(' ')
|
18
|
-
paths =
|
20
|
+
paths = # get possible paths, starting with longest
|
21
|
+
pieces.each_with_index.map do |_, x|
|
22
|
+
pieces[0..x].join(' ')
|
23
|
+
end.reverse
|
19
24
|
extensions = (ENV['PATHEXT'] || '').split(';') # handle Windows executables
|
20
25
|
pathdirs = ENV['PATH'].split(File::PATH_SEPARATOR)
|
21
26
|
paths += pathdirs.collect { |dir| paths.collect { |path| File.expand_path(path, dir) } }.flatten
|
22
|
-
editorfile = paths.select
|
23
|
-
FileTest.file?(path) || !
|
24
|
-
|
25
|
-
raise StandardError,
|
27
|
+
editorfile = paths.select do |path|
|
28
|
+
FileTest.file?(path) || !extensions.select { |ext| FileTest.file?(path + ext) }.empty?
|
29
|
+
end.first
|
30
|
+
raise StandardError, 'Editor not found. Please set your EDITOR env variable' if editorfile.nil?
|
31
|
+
|
26
32
|
raw_command = paths[(paths.index editorfile) % pieces.size]
|
27
|
-
editor = "\"#{editorfile}\"#{editor[raw_command.size
|
33
|
+
editor = "\"#{editorfile}\"#{editor[raw_command.size..-1]}"
|
28
34
|
end
|
29
35
|
editor
|
30
36
|
end
|
31
37
|
|
32
|
-
def self.secure_file_delete
|
38
|
+
def self.secure_file_delete(args)
|
33
39
|
file = File.open(args[:file], 'r+')
|
34
40
|
num_bytes = args[:num_bytes]
|
35
41
|
[0xff, 0x55, 0xaa, 0x00].each do |byte|
|
@@ -41,31 +47,30 @@ class Hiera
|
|
41
47
|
File.delete args[:file]
|
42
48
|
end
|
43
49
|
|
44
|
-
def self.write_tempfile
|
50
|
+
def self.write_tempfile(data_to_write)
|
45
51
|
file = Tempfile.open(['eyaml_edit', '.yaml'])
|
46
52
|
path = file.path
|
47
53
|
file.close!
|
48
54
|
|
49
|
-
file = File.open(path,
|
50
|
-
file.chmod(
|
55
|
+
file = File.open(path, 'w')
|
56
|
+
file.chmod(0o600)
|
51
57
|
if ENV['OS'] == 'Windows_NT'
|
52
58
|
# Windows doesn't support chmod
|
53
59
|
icacls = 'C:\Windows\system32\icacls.exe'
|
54
60
|
if File.executable? icacls
|
55
61
|
current_user = `C:\\Windows\\system32\\whoami.exe`.chomp
|
56
62
|
# Use ACLs to restrict access to the current user only
|
57
|
-
command = %
|
63
|
+
command = %(#{icacls} "#{file.path}" /grant:r "#{current_user}":f /inheritance:r)
|
58
64
|
system "#{command} >NUL 2>&1"
|
59
65
|
end
|
60
66
|
end
|
61
67
|
file.puts data_to_write
|
62
68
|
file.close
|
63
69
|
|
64
|
-
LoggingHelper
|
70
|
+
LoggingHelper.debug "Wrote temporary file: #{path}"
|
65
71
|
|
66
72
|
path
|
67
73
|
end
|
68
|
-
|
69
74
|
end
|
70
75
|
end
|
71
76
|
end
|
@@ -5,35 +5,33 @@ class Hiera
|
|
5
5
|
module Backend
|
6
6
|
module Eyaml
|
7
7
|
class EncryptHelper
|
8
|
-
|
9
|
-
def self.write_important_file args
|
8
|
+
def self.write_important_file(args)
|
10
9
|
require 'hiera/backend/eyaml/highlinehelper'
|
11
|
-
filename = args[
|
12
|
-
content = args[
|
13
|
-
mode = args[
|
14
|
-
if File.file? "#{filename}"
|
15
|
-
raise StandardError,
|
10
|
+
filename = args[:filename]
|
11
|
+
content = args[:content]
|
12
|
+
mode = args[:mode]
|
13
|
+
if File.file?("#{filename}") && !(HighlineHelper.confirm? "Are you sure you want to overwrite \"#{filename}\"?")
|
14
|
+
raise StandardError,
|
15
|
+
'User aborted'
|
16
16
|
end
|
17
|
-
open(
|
17
|
+
open("#{filename}", 'w') do |io|
|
18
18
|
io.write(content)
|
19
19
|
end
|
20
|
-
File.chmod(
|
20
|
+
File.chmod(mode, filename) unless mode.nil?
|
21
21
|
end
|
22
22
|
|
23
|
-
def self.ensure_key_dir_exists
|
23
|
+
def self.ensure_key_dir_exists(key_file)
|
24
24
|
key_dir = File.dirname key_file
|
25
25
|
|
26
|
-
|
27
|
-
begin
|
28
|
-
FileUtils.mkdir_p key_dir
|
29
|
-
LoggingHelper::info "Created key directory: #{key_dir}"
|
30
|
-
rescue
|
31
|
-
raise StandardError, "Cannot create key directory: #{key_dir}"
|
32
|
-
end
|
33
|
-
end
|
26
|
+
return if File.directory? key_dir
|
34
27
|
|
28
|
+
begin
|
29
|
+
FileUtils.mkdir_p key_dir
|
30
|
+
LoggingHelper.info "Created key directory: #{key_dir}"
|
31
|
+
rescue StandardError
|
32
|
+
raise StandardError, "Cannot create key directory: #{key_dir}"
|
33
|
+
end
|
35
34
|
end
|
36
|
-
|
37
35
|
end
|
38
36
|
end
|
39
37
|
end
|
@@ -4,79 +4,76 @@ require 'hiera/backend/eyaml/encrypthelper'
|
|
4
4
|
class Hiera
|
5
5
|
module Backend
|
6
6
|
module Eyaml
|
7
|
-
|
8
7
|
class Encryptor
|
9
|
-
|
10
8
|
class << self
|
11
|
-
attr_accessor :options
|
12
|
-
attr_accessor :tag
|
9
|
+
attr_accessor :options, :tag
|
13
10
|
end
|
14
11
|
|
15
|
-
def self.find
|
12
|
+
def self.find(encryption_scheme = nil)
|
16
13
|
encryption_scheme = Eyaml.default_encryption_scheme if encryption_scheme.nil?
|
17
14
|
require "hiera/backend/eyaml/encryptors/#{File.basename encryption_scheme.downcase}"
|
18
|
-
encryptor_module = Module.const_get(
|
19
|
-
encryptor_class = Utils.find_closest_class :
|
20
|
-
|
15
|
+
encryptor_module = Module.const_get(:Hiera).const_get(:Backend).const_get(:Eyaml).const_get(:Encryptors)
|
16
|
+
encryptor_class = Utils.find_closest_class parent_class: encryptor_module, class_name: encryption_scheme
|
17
|
+
if encryptor_class.nil?
|
18
|
+
raise StandardError,
|
19
|
+
"Could not find hiera-eyaml encryptor: #{encryption_scheme}. Try gem install hiera-eyaml-#{encryption_scheme.downcase} ?"
|
20
|
+
end
|
21
|
+
|
21
22
|
encryptor_class
|
22
23
|
end
|
23
24
|
|
24
|
-
def self.encode
|
25
|
+
def self.encode(binary_string)
|
25
26
|
Base64.strict_encode64(binary_string)
|
26
27
|
end
|
27
28
|
|
28
|
-
def self.decode
|
29
|
+
def self.decode(string)
|
29
30
|
Base64.decode64(string)
|
30
31
|
end
|
31
32
|
|
32
|
-
def self.encrypt *
|
33
|
+
def self.encrypt *_args
|
33
34
|
raise StandardError, "encrypt() not defined for encryptor plugin: #{self}"
|
34
35
|
end
|
35
36
|
|
36
|
-
def self.decrypt *
|
37
|
+
def self.decrypt *_args
|
37
38
|
raise StandardError, "decrypt() not defined for decryptor plugin: #{self}"
|
38
39
|
end
|
39
40
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
self.to_s.split("::").last.downcase
|
44
|
-
end
|
45
|
-
|
46
|
-
def self.register
|
47
|
-
Hiera::Backend::Eyaml::Plugins.register_options :options => self.options, :plugin => plugin_classname
|
48
|
-
end
|
41
|
+
def self.plugin_classname
|
42
|
+
to_s.split('::').last.downcase
|
43
|
+
end
|
49
44
|
|
50
|
-
|
51
|
-
|
52
|
-
|
45
|
+
def self.register
|
46
|
+
Hiera::Backend::Eyaml::Plugins.register_options options: options, plugin: plugin_classname
|
47
|
+
end
|
53
48
|
|
54
|
-
|
55
|
-
|
56
|
-
|
49
|
+
def self.option(name)
|
50
|
+
Eyaml::Options["#{plugin_classname}_#{name}"] || options["#{plugin_classname}_#{name}"]
|
51
|
+
end
|
57
52
|
|
58
|
-
|
59
|
-
|
60
|
-
|
53
|
+
def self.hiera?
|
54
|
+
Utils.hiera?
|
55
|
+
end
|
61
56
|
|
62
|
-
|
63
|
-
|
64
|
-
|
57
|
+
def self.format_message(msg)
|
58
|
+
"[eyaml_#{plugin_classname}]: #{msg}"
|
59
|
+
end
|
65
60
|
|
66
|
-
|
67
|
-
|
68
|
-
|
61
|
+
def self.trace(msg)
|
62
|
+
LoggingHelper.trace from: plugin_classname, msg: msg
|
63
|
+
end
|
69
64
|
|
70
|
-
|
71
|
-
|
72
|
-
|
65
|
+
def self.debug(msg)
|
66
|
+
LoggingHelper.debug from: plugin_classname, msg: msg
|
67
|
+
end
|
73
68
|
|
74
|
-
|
75
|
-
|
76
|
-
|
69
|
+
def self.info(msg)
|
70
|
+
LoggingHelper.info from: plugin_classname, msg: msg
|
71
|
+
end
|
77
72
|
|
73
|
+
def self.warn(msg)
|
74
|
+
LoggingHelper.warn from: plugin_classname, msg: msg
|
75
|
+
end
|
78
76
|
end
|
79
|
-
|
80
77
|
end
|
81
78
|
end
|
82
79
|
end
|