Puppet Plan: complyadm::install::create_offline_bundle

Defined in:
plans/install/create_offline_bundle.pp

Overview

On airgapped environments where ssh access is not permitted to the target node, this plan can be used to create a bundle from a non airgapped node that can be copied and extracted on the airgapped node. This archive will contain all the required modules and images required to install Security Compliance Management.

Parameters:

  • comply_version (String) (defaults to: 'v3.0.0')

    Version that we are creating bundle for

  • assessor_version (String) (defaults to: '4.41.0')

    Version to include in the bundle

Returns:

  • This plan does not return anything



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'plans/install/create_offline_bundle.pp', line 9

plan complyadm::install::create_offline_bundle(
  String $comply_version = 'v3.0.0',
  String $assessor_version = '4.41.0',
) {
  run_command('rm -f project.zip', 'localhost')
  $images = lookup('complyadm::images')
  $images_cache_dir = file::join(complyadm::download_dir(), 'images')

  without_default_logging() || {
    run_command("mkdir -p ${images_cache_dir}", 'localhost')
  }

  $images.each |$image_name, $image| {
    $filename = "${regsubst($image, '[\/:]', '_', 'G')}.tar.gz"
    $local_cached_image_tar_path = file::join($images_cache_dir, $filename)
    $download_url = "https://storage.googleapis.com/comply-images/${filename}"
    complyadm::download_image($download_url, $local_cached_image_tar_path)
  }

  out::message('Creating ZIP Bundle, Please wait...')
  run_command('zip -r project.zip *', 'localhost')

  out::message('project.zip created')
}