Puppet Plan: cd4peadm::preflight

Defined in:
plans/preflight.pp

Overview

Check whether the configured infra is fit for CD4PE installation and prints results. Runs all “sub” preflight plans.

Parameters:

  • config (Cd4peadm::Config) (defaults to: cd4peadm::config())

    Cd4peadm::Config config object from Hiera



8
9
10
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
# File 'plans/preflight.pp', line 8

plan cd4peadm::preflight(
  Cd4peadm::Config $config = cd4peadm::config()
) {
  without_default_logging () || {
    out::message('architecture: checking for supported configuration')
    $arch_result = run_plan('cd4peadm::preflight::architecture', config => $config)
    out::message(cd4peadm::checks::format_results($arch_result))

    if(length($arch_result['failed']) > 0) {
      out::message(cd4peadm::checks::format_summary([$arch_result]))
      fail_plan($arch_result['failed'][0], 'cd4pe/error')
    }

    $targets = $config['all_targets']

    out::message('runtime: checking for installed container runtimes')
    $runtime_conflict_result = run_plan('cd4peadm::preflight::runtime::conflict', config => $config)
    out::message(cd4peadm::checks::format_results($runtime_conflict_result))

    out::message('memory: checking for required 7.45 GiB')
    apply_prep($targets, { '_run_as' => 'root' })
    $memory_result = run_plan('cd4peadm::preflight::memorycheck', config => $config)
    out::message(cd4peadm::checks::format_results($memory_result))

    out::message('os: checking for supported operating system')
    $os_result = run_plan('cd4peadm::preflight::oscheck', config => $config)
    out::message(cd4peadm::checks::format_results($os_result))

    out::message('processors: checking for required 4 CPUs')
    $processor_result = run_plan('cd4peadm::preflight::processorcheck', config => $config)
    out::message(cd4peadm::checks::format_results($processor_result))

    $results = [$arch_result, $runtime_conflict_result, $memory_result, $os_result, $processor_result]
    out::message(cd4peadm::checks::format_summary($results))

    $aggregated_results = cd4peadm::checks::aggregate_results($results)

    if(length($aggregated_results[failed]) > 0) {
      fail_plan('One or more preflight checks did not pass', 'cd4pe/error')
    }
  }
}