Class: CemAcpt::ImageBuilder::ProvisionCommands::DebianFamily

Inherits:
Object
  • Object
show all
Defined in:
lib/cem_acpt/image_builder/provision_commands.rb

Constant Summary collapse

CODENAME_MAP =
{
  'ubuntu' => {
    '2004' => 'focal',
    '2204' => 'jammy',
    '2404' => 'noble',
  },
  'debian' => {
    '12' => 'bookworm',
  },
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(config, image_name, base_image, os_major_version, puppet_version, os: 'ubuntu') ⇒ DebianFamily

Returns a new instance of DebianFamily.



111
112
113
114
115
116
117
118
# File 'lib/cem_acpt/image_builder/provision_commands.rb', line 111

def initialize(config, image_name, base_image, os_major_version, puppet_version, os: 'ubuntu')
  @config = config
  @image_name = image_name
  @base_image = base_image
  @os = os
  @os_major_version = os_major_version
  @puppet_version = puppet_version
end

Instance Method Details

#default_provision_commandsObject



120
121
122
# File 'lib/cem_acpt/image_builder/provision_commands.rb', line 120

def default_provision_commands
  [install_curl_command, enable_puppet_repository_command, set_repo_username_and_password, upgrade_packages_command, install_puppet_agent_command].flatten
end

#provision_commandsObject Also known as: to_a



124
125
126
127
128
129
130
131
# File 'lib/cem_acpt/image_builder/provision_commands.rb', line 124

def provision_commands
  commands_from_config = @config.get("images.#{@image_name}.provision_commands") || []
  if @config.get("images.#{@image_name}.skip_default_provision_commands")
    commands_from_config.compact
  else
    (default_provision_commands + commands_from_config).compact
  end
end