Puppet Plan: ora_install::install_oracle_home_and_patch

Defined in:
plans/install_oracle_home_and_patch.pp

Summary

This plan will install a new ORACLE_HOME and apply the specified patches to it.

Overview

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

--

Examples:

bolt plan run ora_install::install_oracle_home_and_patch -t localhost version=18.0.0.0 file=LINUX.X64_180000_db_home oracle_base=/u01/app/oracle/admin oracle_home=/u01/app/oracle/product/18.0.0.0/db_home2 ora_inventory_dir=/u01/app puppet_download_mnt_point=/nfs_share/software patch_file=p6880880_190000_Linux-x86-64.zip opversion=12.2.0.1.17 patch_list='{"/u01/app/oracle/product/18.0.0.0/db_home2:30116795": {"source": "/nfs_share/software/p30116795_180000_Linux-x86-64.zip", "sub_patches": ["30112122","30113775"]}}'

Parameters:

  • dbserver (TargetSpec)

    The target for this plan.

  • version (Ora_install::Version) (defaults to: undef)

    The version that is installed in the used Oracle home.

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

    A directory to use as Oracle base directory.

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

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

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

    The source file to use for the ORACLE_HOME installation.

  • 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.

  • group_install (String[1]) (defaults to: 'oinstall')

    The os group to use for installation.

  • group_oper (String[1]) (defaults to: 'oper')

    The OS group to allow operator rights.

  • database_type (Enum['SE2', 'SE', 'EE', 'SEONE']) (defaults to: 'EE')

    Selects the type of database you want to install.

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

    The directory where the Puppet software puts all downloaded files.

  • temp_dir (Stdlib::Absolutepath) (defaults to: '/tmp')

    Directory to use for temporary files.

  • dirs (Optional[Array[Stdlib::Absolutepath]]) (defaults to: [])

    Directories that should be created in this plan. For example the parent directory (tree) of the GRID_HOME.

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

    A comma seperated list of the nodes running in the RAC cluster.

  • ora_inventory_dir (Optional[Stdlib::Absolutepath]) (defaults to: '/u01/app')

    The directory that contains the oracle inventory.

  • puppet_download_mnt_point (Optional[String[1]]) (defaults to: 'puppet:///modules/software')

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

  • 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.

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

    The source of the patch. Can be either an extracted folder or the raw zip file.

  • patch_list (Hash) (defaults to: {})

    List of patches to apply.

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

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

Options Hash (patch_list):

  • source (String[1])

    Full path to the zipfile that contains the patch

  • sub_patches (Array)

    List of patch numbers that are part of the patchset



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# File 'plans/install_oracle_home_and_patch.pp', line 84

plan ora_install::install_oracle_home_and_patch(
  TargetSpec                       $dbserver,
  Ora_install::Version             $version                   = undef,
  Stdlib::Absolutepath             $oracle_base               = undef,
  Stdlib::Absolutepath             $oracle_home               = undef,
  String[1]                        $file                      = undef,
  String[1]                        $user                      = 'oracle',
  String[1]                        $group                     = 'dba',
  String[1]                        $group_install             = 'oinstall',
  String[1]                        $group_oper                = 'oper',
  Enum['SE2', 'SE', 'EE', 'SEONE'] $database_type             = 'EE',
  Stdlib::Absolutepath             $download_dir              = '/install',
  Stdlib::Absolutepath             $temp_dir                  = '/tmp',
  Optional[Array[Stdlib::Absolutepath]]
  $dirs                      = [],
  Optional[String[1]]              $cluster_nodes             = undef,
  Optional[Stdlib::Absolutepath]   $ora_inventory_dir         = '/u01/app',
  Optional[String[1]]              $puppet_download_mnt_point = 'puppet:///modules/software',
  # opatch_upgrade
  String[1]                        $patch_file                = undef,
  Optional[Integer]                $csi_number                = undef,
  Optional[String[1]]              $support_id                = undef,
  String[1]                        $opversion                 = undef,
  # patch_oracle_home
  Optional[String[1]]              $source                    = undef,
  Hash                             $patch_list                = {},
  Optional[Enum['json','pretty']]  $format                    = 'pretty',
) {
  if get_targets($dbserver).length > 1 {
    fail_plan("${dbserver} did not resolve to a single target")
  }
  $install_params = {
    'version'                   => $version,
    'oracle_base'               => $oracle_base,
    'oracle_home'               => $oracle_home,
    'file'                      => $file,
    'user'                      => $user,
    'group'                     => $group,
    'group_install'             => $group_install,
    'group_oper'                => $group_oper,
    'database_type'             => $database_type,
    'download_dir'              => $download_dir,
    'temp_dir'                  => $temp_dir,
    'dirs'                      => $dirs,
    'cluster_nodes'             => $cluster_nodes,
    'ora_inventory_dir'         => $ora_inventory_dir,
    'puppet_download_mnt_point' => $puppet_download_mnt_point,
    'format'                    => $format,
  }
  $install_oracle_home = run_plan('ora_install::install_oracle_home', $dbserver, $install_params)
  case $install_oracle_home {
    'Error'  : { fail_plan($install_oracle_home) }
    default : {}
  }
  $opatch_upgrade_params = {
    '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,
  }
  $opatch_upgrade = run_plan('ora_install::opatch_upgrade',      $dbserver, $opatch_upgrade_params)
  case $opatch_upgrade {
    'Error'   : { fail_plan($opatch_upgrade) }
    default : {}
  }
  $patch_home_params = {
    'install_group' => $group_install,
    'os_user'       => $user,
    'source'        => $source,
    'patch_list'    => $patch_list,
    'tmp_dir'       => $temp_dir,
  }
  $patch_home = run_plan('ora_install::patch_home',   $dbserver, $patch_home_params)
  case $patch_home {
    'Error'   : { fail_plan($patch_home) }
    default : {}
  }
}