kafo 6.5.0 → 7.0.0

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
  SHA256:
3
- metadata.gz: 2224fcf87240686b6638ceffdde5ea8026baf151e784f90f1903389305996ae8
4
- data.tar.gz: c6ea88ba2845dfa6d34281c78f7f4a70073c9f6a7bb971f97a0a8cdc7e2897d8
3
+ metadata.gz: 8ae11e11628c99446f1b247135f656e0f5546c6045499b05b9b00b83665b5afc
4
+ data.tar.gz: bd4361d90a598e7f3beb6a27f28a5f7992a0e30b033f327cfbe5dd0488676766
5
5
  SHA512:
6
- metadata.gz: 373d68b4cc0c8ee1e43e991c4eea2bd632f3de482d797fde26156b38975ee4eef8b0a4cd0cc934ed8c3d9b341e7a429df57b2077496710ed8f187890b1186669
7
- data.tar.gz: f7d9a1356a7f260fa7baa605642c6c00d6276a9064330a03f2864561427ba0eeb99947daae84d951f9647798fac8870c7517fb9b3dd7e3330e4778d5a7975ca0
6
+ metadata.gz: 709acb14a02a183b1f3b5b604014d6d22aedca7d15e08fdd29408296aa189d9813be07b873cb151b412015b5a0c3b313a6224e7e91c8dea5a44c77063fb0b263
7
+ data.tar.gz: b53a7e0ddbe08344b26d68a965ad14a550930be9bf943920df2d352a45d5edb1806e4b9612623109a7db33d8470722a36a73429631985f20728cd57446f2f712
data/README.md CHANGED
@@ -160,9 +160,8 @@ As you may have noticed there are several ways how to specify arguments. Here's
160
160
 
161
161
  ## Requirements
162
162
 
163
- Kafo is supported with Puppet versions 4.9+, 5 and 6. Puppet may be installed
164
- as a gem (add it to Gemfile) or through a package, including official AIO
165
- packages.
163
+ Kafo is supported with Puppet version 7. Puppet may be installed as a gem (add
164
+ it to Gemfile) or through a package, including official AIO packages.
166
165
 
167
166
  ## How do I report bugs or contribute?
168
167
 
@@ -207,13 +206,12 @@ When using Puppet via a Gemfile, Bundler should set up PATH to point at the
207
206
  gem version. If using a system/packaged version, it will typically find and
208
207
  execute /usr/bin/puppet from the regular PATH.
209
208
 
210
- When using an AIO/PC1 packaged version of Puppet, other versions of Puppet from
209
+ When using an AIO packaged version of Puppet, other versions of Puppet from
211
210
  PATH will be preferred if they exist, so they should either be removed or PATH
212
211
  set to prefer /opt/puppetlabs/bin, i.e. `export PATH=/opt/puppetlabs/bin:$PATH`.
213
212
  Debug logs from Kafo should indicate the full path of the binary used.
214
213
 
215
- Note that Kafo parsers supports specific versions of Puppet, and may require
216
- extra modules (such as puppet-strings on Puppet 4+) to parse manifests.
214
+ Note that Kafo parsers relies on puppet-strings to parse manifests.
217
215
 
218
216
  ## Parameters prefixes
219
217
 
@@ -728,7 +726,7 @@ If you use "params_path" for this purpose, "params_name" is ignored.
728
726
 
729
727
  ## Validations
730
728
 
731
- If class parameters are declared with Puppet 4 data types then Kafo will
729
+ If class parameters are declared with Puppet data types then Kafo will
732
730
  validate user inputs against Puppet's type validation rules.
733
731
 
734
732
  ## Enabling or disabling module
data/bin/kafofy CHANGED
@@ -47,7 +47,7 @@ end
47
47
 
48
48
  # Create default config file
49
49
  puts "creating #{options[:config_file]} as a default scenario file"
50
- if !File.exists?(options[:config_file])
50
+ if !File.exist?(options[:config_file])
51
51
  puts "... creating config file #{options[:config_file]}"
52
52
  FileUtils.touch options[:config_file]
53
53
  File.chmod 0600, options[:config_file]
@@ -61,7 +61,7 @@ end
61
61
  # Installer script
62
62
  script_name = "bin/#{options[:name]}"
63
63
  puts "... creating #{script_name}"
64
- if !File.exists?(script_name)
64
+ if !File.exist?(script_name)
65
65
  content = <<EOS
66
66
  #!/usr/bin/env ruby
67
67
  require 'rubygems'
@@ -6,7 +6,7 @@ module Kafo
6
6
  def add_module(name, items)
7
7
  data = by_parameter_groups(items)
8
8
  if data.keys.size > 1
9
- puts module_header(name + ':')
9
+ line module_header(name + ':')
10
10
  data.keys.each do |group|
11
11
  add_list(header(2, group), data[group])
12
12
  end
@@ -17,7 +17,7 @@ module Kafo
17
17
  def add_list(heading, items)
18
18
  return if items.empty?
19
19
  if heading == 'Options'
20
- puts "\n#{heading}:"
20
+ line "\n#{heading}:"
21
21
 
22
22
  data = by_module(items)
23
23
 
@@ -304,7 +304,7 @@ module Kafo
304
304
  store = Store.new()
305
305
  store_path = self.class.config.app[:store_dir]
306
306
  store_path = File.expand_path(File.join(CONFIG_DIR, '../store.d')) if store_path.empty? && defined?(CONFIG_DIR)
307
- store.add_dir(store_path) if File.exists?(store_path)
307
+ store.add_dir(store_path) if File.exist?(store_path)
308
308
  store
309
309
  end
310
310
 
@@ -556,10 +556,10 @@ module Kafo
556
556
  end
557
557
 
558
558
  def config_file
559
- return CONFIG_FILE if defined?(CONFIG_FILE) && File.exists?(CONFIG_FILE)
559
+ return CONFIG_FILE if defined?(CONFIG_FILE) && File.exist?(CONFIG_FILE)
560
560
  return self.class.scenario_manager.select_scenario if self.class.scenario_manager.configured?
561
- return '/etc/kafo/kafo.yaml' if File.exists?('/etc/kafo/kafo.yaml')
562
- return "#{::RbConfig::CONFIG['sysconfdir']}/kafo/kafo.yaml" if File.exists?("#{::RbConfig::CONFIG['sysconfdir']}/kafo/kafo.yaml")
561
+ return '/etc/kafo/kafo.yaml' if File.exist?('/etc/kafo/kafo.yaml')
562
+ return "#{::RbConfig::CONFIG['sysconfdir']}/kafo/kafo.yaml" if File.exist?("#{::RbConfig::CONFIG['sysconfdir']}/kafo/kafo.yaml")
563
563
  File.join(Dir.pwd, 'config', 'kafo.yaml')
564
564
  end
565
565
 
@@ -73,16 +73,11 @@ module Kafo
73
73
  def manifest
74
74
  %{echo '
75
75
  $kafo_config_file="#{@configuration.config_file}"
76
- #{add_progress}
77
76
  #{generate_version_checks.join("\n") if @puppet_version_check}
78
77
  #{@command}
79
78
  '}
80
79
  end
81
80
 
82
- def add_progress
83
- %{$kafo_add_progress=#{!KafoConfigure.verbose}}
84
- end
85
-
86
81
  def generate_version_checks
87
82
  checks = []
88
83
  modules_path.each do |modulepath|
@@ -36,7 +36,7 @@ module Kafo
36
36
  if @configuration.module_dirs.count == 1
37
37
  module_dir = @configuration.module_dirs.first
38
38
  else
39
- module_dir = @configuration.module_dirs.find { |dir| File.exists?(File.join(dir, module_manifest_path)) } ||
39
+ module_dir = @configuration.module_dirs.find { |dir| File.exist?(File.join(dir, module_manifest_path)) } ||
40
40
  warn("Manifest #{module_manifest_path} was not found in #{@configuration.module_dirs.join(', ')}")
41
41
  end
42
42
  @manifest_path = File.join(module_dir, module_manifest_path)
data/lib/kafo/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # encoding: UTF-8
2
2
  module Kafo
3
3
  PARSER_CACHE_VERSION = 1
4
- VERSION = "6.5.0"
4
+ VERSION = "7.0.0"
5
5
  end
@@ -3,15 +3,6 @@
3
3
  # optional $answers class parameter
4
4
  # $modulepath/config/answers.yaml
5
5
  # /etc/kafo-configure/answers.yaml
6
- #
7
- # @param add_progress
8
- # Whether to add a progress bar. Only works on Puppet < 6.
9
- class kafo_configure(
10
- Boolean $add_progress = $::kafo_add_progress,
11
- ) {
12
- if $add_progress and SemVer($facts['puppetversion']) =~ SemVerRange('< 6.0.0') {
13
- add_progress()
14
- }
15
-
6
+ class kafo_configure {
16
7
  lookup('classes', {merge => unique}).include
17
8
  }
@@ -2,16 +2,9 @@ require 'spec_helper'
2
2
 
3
3
  describe 'kafo_configure' do
4
4
  let(:hiera_config) { 'spec/fixtures/hiera/hiera.yaml' }
5
- let(:facts) { { puppetversion: Puppet.version } }
6
5
 
7
6
  context 'without parameters' do
8
- let(:params) { {add_progress: false} }
9
7
  it { is_expected.to compile.with_all_deps }
10
8
  it { is_expected.to contain_class('dummy') }
11
9
  end
12
-
13
- context 'with progress' do
14
- let(:params) { {add_progress: true} }
15
- it { is_expected.to compile.with_all_deps }
16
- end
17
10
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kafo
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.5.0
4
+ version: 7.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marek Hulan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-31 00:00:00.000000000 Z
11
+ date: 2023-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -148,20 +148,20 @@ dependencies:
148
148
  requirements:
149
149
  - - ">="
150
150
  - !ruby/object:Gem::Version
151
- version: 0.6.2
151
+ version: 1.3.1
152
152
  - - "<"
153
153
  - !ruby/object:Gem::Version
154
- version: 1.3.1
154
+ version: '2'
155
155
  type: :runtime
156
156
  prerelease: false
157
157
  version_requirements: !ruby/object:Gem::Requirement
158
158
  requirements:
159
159
  - - ">="
160
160
  - !ruby/object:Gem::Version
161
- version: 0.6.2
161
+ version: 1.3.1
162
162
  - - "<"
163
163
  - !ruby/object:Gem::Version
164
- version: 1.3.1
164
+ version: '2'
165
165
  - !ruby/object:Gem::Dependency
166
166
  name: highline
167
167
  requirement: !ruby/object:Gem::Requirement
@@ -286,7 +286,6 @@ files:
286
286
  - modules/kafo_configure/lib/puppet/functions/kafo_configure/dump_lookups.rb
287
287
  - modules/kafo_configure/lib/puppet/functions/kafo_configure/dump_variables.rb
288
288
  - modules/kafo_configure/lib/puppet/functions/kafo_configure/to_yaml.rb
289
- - modules/kafo_configure/lib/puppet/parser/functions/add_progress.rb
290
289
  - modules/kafo_configure/manifests/dump_values.pp
291
290
  - modules/kafo_configure/manifests/init.pp
292
291
  - modules/kafo_configure/manifests/puppet_version_semver.pp
@@ -313,14 +312,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
313
312
  requirements:
314
313
  - - ">="
315
314
  - !ruby/object:Gem::Version
316
- version: 2.4.0
315
+ version: '2.7'
317
316
  required_rubygems_version: !ruby/object:Gem::Requirement
318
317
  requirements:
319
318
  - - ">="
320
319
  - !ruby/object:Gem::Version
321
320
  version: '0'
322
321
  requirements: []
323
- rubygems_version: 3.2.22
322
+ rubygems_version: 3.4.10
324
323
  signing_key:
325
324
  specification_version: 4
326
325
  summary: A gem for making installations based on puppet user friendly
@@ -1,43 +0,0 @@
1
- module Puppet::Parser::Functions
2
- newfunction(:add_progress) do |args|
3
- loaded = false
4
- begin
5
- require 'puppet/transaction'
6
- loaded = true
7
- rescue LoadError
8
- ::Puppet.warning 'Unable to load puppet/transaction for progress bar support, this version may not be supported'
9
- end
10
-
11
- if loaded
12
- # Monkey patch the transaction to put our wrapper around the report object
13
- class Puppet::Transaction
14
- attr_accessor :in_main_catalog
15
-
16
- def is_interesting?(resource)
17
- return false if resource.class.name == :component # ignore defined types
18
- ![:schedule, :class, :stage, :filebucket, :anchor, :concat_fragment].include?(resource.to_s.split('[')[0].downcase.to_sym)
19
- end
20
-
21
- def tracked_resources
22
- @tracked_resources ||= catalog.vertices.select { |resource| is_interesting?(resource) }.map(&:to_s)
23
- end
24
-
25
- def evaluate_with_trigger(*args, &block)
26
- if catalog.version
27
- self.in_main_catalog = true
28
- tracked_resources.each { |r| ::Puppet.info "MONITOR_RESOURCE #{r}" }
29
- end
30
- evaluate_without_trigger(*args, &block)
31
- self.in_main_catalog = false if catalog.version
32
- end
33
-
34
- if method_defined?(:evaluate) && method_defined?(:report)
35
- alias_method :evaluate_without_trigger, :evaluate
36
- alias_method :evaluate, :evaluate_with_trigger
37
- else
38
- ::Puppet.warning 'Unable to patch Puppet transactions for progress bar support, this version may not be supported'
39
- end
40
- end
41
- end
42
- end
43
- end