Puppet Plan: cd4peadm::install

Defined in:
plans/install.pp

Summary

Install CD4PE

Overview

This plan will install a new v5 CD4PE instance. If existing configuration is found in ‘data/common.yaml`, it will prompt to see if it should be used. If no configuration is found, it will prompt for the necessary information to install.

Returns:

  • none



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

plan cd4peadm::install() {
  cd4peadm::print_welcome_message()
  get_target('localhost').set_var('printed_welcome_message', true)

  run_plan('cd4peadm::check_bolt_version')

  $config_path = "${cd4peadm::bolt_project_dir()}/data/common.yaml"
  if file::exists($config_path) {
    $use_existing = Boolean(prompt("Existing config found at ${config_path}. Would you like to use it?", 'default' => 'yes'))
    if $use_existing {
      out::message('Using existing config.')

      # When an existing config is used, we can't guarantee generate_config has been run,
      # so we need to directly check for a hiera.yaml file and create it if it doesn't exist.
      run_plan('cd4peadm::install::create_hiera_config')

      run_plan('cd4peadm::install_from_config')
    } else {
      out::message('Overwriting config.')

      run_plan('cd4peadm::install::new::bootstrap')
      run_plan('cd4peadm::install_from_config')
    }
  } else {
    run_plan('cd4peadm::install::new::bootstrap')
    run_plan('cd4peadm::install_from_config')
  }
}