Puppet Plan: cd4peadm::install_from_config
- Defined in:
- plans/install_from_config.pp
Summary
Install CD4PE based on an existing Hiera configOverview
This plan is designed to be run after the ‘generate_config` plan has created a valid Hiera config with the setting required for install. To install CD4PE without prompts, first run `cd4peadm::generate_config`, then this plan.
Note that these plans are used implicitly by the ‘cd4peadm::install` plan, which prompts the user for input instead of requiring it to be supplied as plan parameters to `generate_config`.
This plan will fail if it detects an existing CD4PE install.
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 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'plans/install_from_config.pp', line 13
plan cd4peadm::install_from_config() {
if(!get_target('localhost').vars['printed_welcome_message']) {
cd4peadm::print_welcome_message()
}
run_plan('cd4peadm::check_bolt_version')
$config = cd4peadm::config()
$version_file_check = without_default_logging() || {
run_command(
"test -f ${cd4peadm::version_file_path()}",
$config['all_targets'],
{ '_run_as' => 'root', '_catch_errors' => true }
)
}
if($version_file_check.error_set.empty) {
$existing_install_message = @("EXISTING_INSTALL")
Existing CD4PE install detected, aborting install.
If you are trying to update the config of an existing install, use `bolt plan run cd4peadm::apply_configuration`.
If you are trying to upgrade to a new version, use `bolt plan run cd4peadm::upgrade`.
| EXISTING_INSTALL
fail_plan($existing_install_message)
}
run_plan('cd4peadm::preflight',
config => $config,
)
run_plan('cd4peadm::install::runtime',
config => $config,
)
run_plan('cd4peadm::install::upload_images',
config => $config,
)
run_command('mkdir /etc/puppetlabs',
$config['all_targets'],
{ '_run_as' => 'root', '_catch_errors' => true }
)
get_target('localhost').set_var('service_will_be_restarted_by_caller', true)
run_plan('cd4peadm::upload_license',
config => $config,
)
run_plan('cd4peadm::install::roles',
config => $config,
)
run_plan('cd4peadm::install::wait_for_services',
config => $config,
)
run_plan('cd4peadm::install::update_root_credentials',
config => $config,
)
write_file(cd4peadm::module_version(),
cd4peadm::version_file_path(),
$config['all_targets'],
{ '_run_as' => 'root' }
)
run_plan('cd4peadm::install::overview',
config => $config
)
}
|