Puppet Plan: ora_install::switch_home_asm
- Defined in:
- plans/switch_home_asm.pp
Summary
This plan will switch an Grid Infrastructure installation to an already existing other GRID_HOME.Overview
See the file “LICENSE” for the full license governing this code.
--
–++–
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 |
# File 'plans/switch_home_asm.pp', line 24
plan ora_install::switch_home_asm(
#lint:ignore:strict_indent
TargetSpec $dbserver,
Stdlib::Absolutepath $new_home,
Optional[Enum['json','pretty']] $format = 'pretty',
Optional[Optional[Enum['debug', 'info', 'notice', 'warning', 'err', 'alert', 'emerg', 'crit']]]
$verbose = 'info',
#lint:endignore:strict_indent
) {
if get_targets($dbserver).length > 1 {
fail_plan("${dbserver} did not resolve to a single target")
}
$defaults = { format => $format, verbose => $verbose, '_catch_errors' => true }
$tasks = [
{ 'ora_install::agent_action' => { action => 'disable', comment => "Switching grid home to ${new_home}" } },
{ 'ora_install::grid_action' => { action => 'stop' } },
{ 'ora_install::switch_grid_home' => { new_home => $new_home } },
{ 'ora_install::grid_action' => { action => 'start' } },
{ 'ora_install::agent_action' => { action => 'enable' } },
]
$tasks.each |$ind, $task| {
$task.each |$key, $params| {
$all_params = $params + $defaults
$output = run_task($key, $dbserver, $all_params)
$output.each |$result| {
if $result.ok {
if is_hash($result['message']) {
$message = $result['message']['message']
} else {
$message = $result['message']
}
out::message("Task ${key} on ${dbserver} returned a value:\n${message}")
} else {
out::message("Task ${key} on ${dbserver} failed:\n${result['message']}")
fail_plan("Task ${key} on ${dbserver} failed:\n${result['_error']['msg']}", $result['_error']['kind'], { 'failedtargets' => $dbserver })
}
}
}
}
}
|