Puppet Plan: ora_install::opatch_upgrade

Defined in:
plans/opatch_upgrade.pp

Summary

This plan will install a new version of OPatch in specified ORACLE_HOME.

Overview

See the file “LICENSE” for the full license governing this code.

--

Examples:

bolt plan run ora_install::opatch_upgrade -t localhost oracle_home=/u01/app/oracle/product/18.0.0.0/db_home2 patch_file=p6880880_190000_Linux-x86-64.zip opversion=12.2.0.1.17 puppet_download_mnt_point=/nfs_share/software

Parameters:

  • dbserver (TargetSpec)

    The target for this plan.

  • oracle_home (Stdlib::Absolutepath) (defaults to: undef)

    A directory to be used as Oracle home directory for this software.

  • patch_file (String[1]) (defaults to: undef)

    The zip file containing the Opatch utility.

  • csi_number (Optional[Integer]) (defaults to: undef)

    The Customer Service Identification number.

  • support_id (Optional[String[1]]) (defaults to: undef)

    Your support ID.

  • opversion (String[1]) (defaults to: undef)

    The version of Opatch you want to install.

  • user (String[1]) (defaults to: 'oracle')

    The user used for the specified installation.

  • group (String[1]) (defaults to: 'dba')

    The os group to use for these Oracle puppet definitions.

  • download_dir (Stdlib::Absolutepath) (defaults to: '/install')

    The directory where the Puppet software puts all downloaded files.

  • puppet_download_mnt_point (Optional[String[1]]) (defaults to: undef)

    The base path of all remote files for the defined type or class.

  • format (Optional[Enum['json','pretty']]) (defaults to: 'pretty')

    Specify the format of the output, human readable (pretty) or not (json).



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
83
84
# File 'plans/opatch_upgrade.pp', line 44

plan ora_install::opatch_upgrade(
  TargetSpec                       $dbserver,
  Stdlib::Absolutepath             $oracle_home               = undef,
  String[1]                        $patch_file                = undef,
  Optional[Integer]                $csi_number                = undef,
  Optional[String[1]]              $support_id                = undef,
  String[1]                        $opversion                 = undef,
  String[1]                        $user                      = 'oracle',
  String[1]                        $group                     = 'dba',
  Stdlib::Absolutepath             $download_dir              = '/install',
  Optional[String[1]]              $puppet_download_mnt_point = undef,
  Optional[Enum['json','pretty']]  $format                    = 'pretty',
) {
  if get_targets($dbserver).length > 1 {
    fail_plan("${dbserver} did not resolve to a single target")
  }

  $dbserver.apply_prep

  $result = apply($dbserver, { required_modules => ['easy_type', 'ora_install'], '_catch_errors' => true }) {
    ora_install::opatchupgrade { "opatch_upgrade_${oracle_home}_${opversion}":
      oracle_home               => $oracle_home,
      patch_file                => $patch_file,
      csi_number                => $csi_number,
      support_id                => $support_id,
      opversion                 => $opversion,
      user                      => $user,
      group                     => $group,
      download_dir              => $download_dir,
      puppet_download_mnt_point => $puppet_download_mnt_point,
    }
  }
  $target_result = $result.first()
  if $target_result.error {
    fail_plan($target_result.error())
  } else {
    $target_result.report['logs'].each |$log| {
      out::message("${log['source']}: ${log['message']}")
    }
  }
}