Puppet Plan: complyadm::install::new::bootstrap

Defined in:
plans/install/new/bootstrap.pp

Summary

Interactive plan that prompts you for configuration information

Overview

Prompts you to answer questions to generate the configuration hiera data file for use with complyadm::install

All sensitive data will be encrypted with hiera-eyaml

You must have an inventory.yaml file first.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'plans/install/new/bootstrap.pp', line 11

plan complyadm::install::new::bootstrap() {
  $inventory_targets = complyadm::bolt_project_inventory_targets()

  complyadm::display()
  if $inventory_targets.size == 0 {
    fail_plan('No targets found. Please create an inventory file. See https://www.puppet.com/docs/comply/3.x/comply.html')
  } elsif $inventory_targets.size == 1 {
    $use_inventory_target = Boolean(prompt("Would you like to use ${inventory_targets[0].name} for an All-In-One install?", 'default' => 'y'))
    if !$use_inventory_target {
      fail_plan('No other inventory targets found, please add more to your inventory file and run again')
    } else {
      $inventory_aio_target = $inventory_targets[0]
    }
  } else {
    $inventory_aio_target = prompt::menu('Which inventory target would you like to use for an All-In-One install?', $inventory_targets)
  }

  complyadm::display()
  $hostname = prompt("What is the DNS-resolvable hostname of the Security Compliance Management web console?\n",
  'default' => $inventory_aio_target.uri)

  #Leaving the below line incase we decide to make assessor version configurable at install
  #$user_assessor_version = prompt::menu('Assessor Version', $assessor_versions, 'default' => $assessor_versions[0])

  complyadm::display("
Select a container runtime supported by the OS of the system you intend to install to. If you are
unsure which container runtime is supported on the install target's OS, please refer to the System
Requirements page of the documentation."
  )
  $runtime = prompt::menu('Choose a container runtime for installation:', ['docker', 'podman'], 'default' => 'docker' )

  complyadm::display("
You can choose to install ${runtime} on the target host. If ${runtime} is already installed or
automatic installation is not supported on the target host's OS, you should answer (n)o.
Please refer to the System Requirements page of the documentation."
  )
  $install_runtime = Boolean(prompt("Would you like to install ${runtime}?", 'default' => 'y'))

  run_plan('complyadm::generate_config', {
      inventory_aio_target => $inventory_aio_target.name,
      resolvable_hostname  => $hostname,
      runtime              => $runtime,
      install_runtime      => $install_runtime,
      assessor_version     => 'latest',
  })
}