Class: CemAcpt::Config::CemAcpt

Inherits:
Base
  • Object
show all
Defined in:
lib/cem_acpt/config/cem_acpt.rb

Overview

Holds the configuration for cem_acpt

Constant Summary collapse

VALID_KEYS =
%i[
  actions
  ci_mode
  config_file
  image_name_builder
  log_level
  log_file
  log_format
  module_dir
  node_data
  no_destroy_nodes
  no_ephemeral_ssh_key
  platform
  provisioner
  quiet
  terraform
  test_data
  tests
  user_config
  verbose
].freeze

Instance Attribute Summary

Attributes inherited from Base

#config, #env_vars

Instance Method Summary collapse

Methods inherited from Base

#[], #ci_mode?, #debug_mode?, #empty?, #env_var_prefix, #explain, #get, #has?, #initialize, #load, #quiet_mode?, #to_json, #to_yaml, #verbose_mode?

Constructor Details

This class inherits a constructor from CemAcpt::Config::Base

Instance Method Details

#defaultsObject

The default configuration



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/cem_acpt/config/cem_acpt.rb', line 36

def defaults
  {
    actions: {},
    ci_mode: false,
    config_file: nil,
    image_name_builder: {
      character_substitutions: ['_', '-'],
      parts: ['cem-acpt', '$image_fam', '$collection', '$firewall'],
      join_with: '-',
    },
    log_level: 'info',
    log_file: nil,
    log_format: 'text',
    module_dir: Dir.pwd,
    node_data: {},
    no_ephemeral_ssh_key: false,
    platform: {
      name: 'gcp',
    },
    quiet: false,
    test_data: {
      for_each: {
        collection: %w[puppet7],
      },
      vars: {},
      name_pattern_vars: %r{^(?<framework>[a-z]+)_(?<image_fam>[a-z0-9-]+)_(?<firewall>[a-z]+)_(?<framework_vars>[-_a-z0-9]+)$},
      vars_post_processing: {
        new_vars: [
          {
            name: 'profile',
            string_split: {
              from: 'framework_vars',
              using: '_',
              part: 0,
            },
          },
          {
            name: 'level',
            string_split: {
              from: 'framework_vars',
              using: '_',
              part: 1,
            },
          },
        ],
        delete_vars: %w[framework_vars],
      },
    },
    tests: [],
    verbose: false,
  }
end

#valid_keysObject



31
32
33
# File 'lib/cem_acpt/config/cem_acpt.rb', line 31

def valid_keys
  VALID_KEYS
end