Module: CemAcpt::ImageBuilder::ProvisionCommands

Defined in:
lib/cem_acpt/image_builder/provision_commands.rb

Overview

Holds methods for determining the provision commands for each supported OS / Puppet version

Defined Under Namespace

Classes: DebianFamily, EnterpriseLinuxFamily, WindowsFamily

Constant Summary collapse

OS_CLASS_MAP =

Map of OS to class that holds the provision commands for that OS

{
  'centos' => 'EnterpriseLinuxFamily',
  'rhel' => 'EnterpriseLinuxFamily',
  'alma' => 'EnterpriseLinuxFamily',
  'oel' => 'EnterpriseLinuxFamily',
  'rocky' => 'EnterpriseLinuxFamily',
  'ubuntu' => 'DebianFamily',
  'windows' => 'WindowsFamily',
}.freeze

Class Method Summary collapse

Class Method Details

.provision_commands(config, image_name:, base_image:, os:, os_major_version:, puppet_version:) ⇒ Object



140
141
142
143
144
145
146
147
# File 'lib/cem_acpt/image_builder/provision_commands.rb', line 140

def provision_commands(config, image_name:, base_image:, os:, os_major_version:, puppet_version:)
  os_major_version = os_major_version.to_s
  puppet_version = puppet_version.to_s
  cmd_klass = OS_CLASS_MAP[os.to_s]
  raise "Unsupported OS: #{os}" unless cmd_klass

  const_get(cmd_klass).new(config, image_name, base_image, os_major_version, puppet_version).provision_commands
end