Defined Type: wls_install::utils::rcu

Defined in:
manifests/utils/rcu.pp

Summary

This is a private class.

Overview

wls_install::utils::rcu

Don’t use direct.

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

Parameters:

  • version (Wls_install::Versions) (defaults to: lookup({ name => 'wls_version', default_value => 1111 }))

    The version that is installed in the used Oracle home. Puppet uses this value to decide on version specific actions.

  • fmw_product (Enum['adf','soa','mft', 'forms','bip']) (defaults to: 'adf')

    Type of Fusion Middleware Product you want to install. Valid values are:

    • adf

    • soa

    • soaqs

    • osb

    • wcc

    • wc

    • oim

    • oam

    • web

    • webgate

    • oud

    • mft

    • b2b

    • forms

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

    Fusion Middleware home.

  • jdk_home_dir (Stdlib::Absolutepath) (defaults to: lookup({ name => 'wls_jdk_home_dir' }))

    The homdirectory for the Java evelopment Kit.

  • os_user (String[1]) (defaults to: lookup({ name => 'wls_os_user' }))

    The os user used to install and run WebLogic.

  • os_group (String[1]) (defaults to: lookup({ name => 'wls_os_group' }))

    The os group used to install and run WebLogic.

  • download_dir (Stdlib::Absolutepath) (defaults to: lookup({ name => 'wls_download_dir' }))

    The directory where the Puppet software puts all downloaded files. Before Puppet can actually use remote files, they must be downloaded first. Puppet uses this directory to put all files in. The default value is: ‘/install`

  • rcu_action (Enum['create','delete']) (defaults to: 'create')

    Action to perform. Valid values are:

    • create

    • delete

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

    The jdbc URL of the RCU repository.

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

    Database URL to create the RCU on.

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

    Extra prefix to use for the RCU.

  • rcu_password (Easy_type::Password) (defaults to: undef)

    The password to use on the database where the RCU repository is created.

  • rcu_sys_user (String[1]) (defaults to: 'sys')

    SYS username to use on the database where the RCU repository is created. Default is ‘SYS’

  • rcu_sys_password (Easy_type::Password) (defaults to: undef)

    SYS password to use on the database where the RCU repository is created.

  • rcu_honor_omf (Optional[Boolean]) (defaults to: undef)

    Boolean to determine if you want the RCU creation to honor OMF (Oracle Managed Files).

  • rcu_soa_profile (Optional[ Enum[ 'SMALL', 'MED', 'LARGE', ] ]) (defaults to: undef)

    Profile to use for creating the RCU for SOA.

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

    The default tablespace to use for the RCU created accounts.

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

    The temporary tablespace to use for the RCU created accounts.

  • logoutput (Variant[ Boolean, Enum[ 'on_failure', ] ]) (defaults to: lookup({ name => 'logoutput', default_value => 'on_failure' }))

    log the outputs of Puppet exec or not. When you specify ‘true` Puppet will log all output of `exec` types. Valid values are:

    • ‘true`

    • ‘false`

    • ‘on_failure`

  • rcu_as_sysdba (Boolean) (defaults to: true)


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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
# File 'manifests/utils/rcu.pp', line 94

define wls_install::utils::rcu (
  Wls_install::Versions   $version                     = lookup({ name => 'wls_version', default_value => 1111 }),
  Enum['adf','soa','mft', 'forms','bip']
  $fmw_product                 = 'adf',
  Stdlib::Absolutepath    $oracle_fmw_product_home_dir = undef,
  Stdlib::Absolutepath    $jdk_home_dir                = lookup({ name => 'wls_jdk_home_dir' }),
  String[1]               $os_user                     = lookup({ name => 'wls_os_user' }),
  String[1]               $os_group                    = lookup({ name => 'wls_os_group' }),
  Stdlib::Absolutepath    $download_dir                = lookup({ name => 'wls_download_dir' }),
  Enum['create','delete'] $rcu_action                  = 'create',
  Optional[String[1]]     $rcu_jdbc_url                = undef,
  Optional[String[1]]     $rcu_database_url            = undef,
  Optional[String[1]]     $rcu_prefix                  = undef,
  Easy_type::Password     $rcu_password                = undef,
  Boolean                 $rcu_as_sysdba               = true,
  String[1]               $rcu_sys_user                = 'sys',
  Easy_type::Password     $rcu_sys_password            = undef,
  Optional[Boolean]       $rcu_honor_omf               = undef,
  Optional[String[1]]     $rcu_temp_tablespace         = undef,
  Optional[String[1]]     $rcu_tablespace              = undef,
  Optional[
    Enum[
      'SMALL',
      'MED',
      'LARGE',
    ]
  ]                       $rcu_soa_profile             = undef,
  Variant[
    Boolean,
    Enum[
      'on_failure',
    ]
  ]                       $logoutput                   = lookup({ name => 'logoutput', default_value => 'on_failure' }),
) {
  #
  # When an other acccount is used then sys, infer that this is a non-sysdba account
  #
  $dba_role = if $rcu_as_sysdba {
    ' -dbRole SYSDBA '
  } else {
    ''
  }

  case $facts['kernel'] {
    'Linux', 'SunOS', 'AIX': {
      $exec_path = '/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin'
    }
    default: {
      fail('Unrecognized operating system')
    }
  }

  if $rcu_temp_tablespace == undef {
    $rcu_temp_tablespace_cmd = ''
  } else {
    $rcu_temp_tablespace_cmd = "-tempTablespace ${rcu_temp_tablespace}"
  }

  if $rcu_tablespace == undef {
    $rcu_tablespace_cmd = ''
  } else {
    $rcu_tablespace_cmd = "-tablespace ${rcu_tablespace}"
  }

  case $rcu_honor_omf {
    true: {
      $honor_omf = '-honorOMF true'
    }
    false: {
      $honor_omf = '-honorOMF false'
    }
    undef: {
      $honor_omf = ''
    }
    default: {
      fail("Unrecognized rcu_honor_omf value ${rcu_honor_omf}. Supported values are undef, true or false")
    }
  }

  case $rcu_soa_profile {
    'SMALL', 'MED', 'LARGE': {
      $soa_profile = "-variables SOA_PROFILE_TYPE=${rcu_soa_profile}"
    }
    undef: {
      $soa_profile = ''
    }
    default: {
      fail("Unrecognized rcu_soa_profile value ${rcu_soa_profile}. Supported values are undef, SMALL, MED & LARGE")
    }
  }

  case $fmw_product {
    'forms': {
      case $version {
        1036, 1111, 1211, 1212, 1213: {
          fail 'unsupported version'
        }
        default: {
          $components = "-component STB ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component IAU ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component IAU_APPEND ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component IAU_VIEWER ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component OPSS ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} "
          $components_passwords = [$rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password]
        }
      }
    }
    'adf': {
      case $version {
        1036, 1111, 1211, 1212, 1213: {
          $components = "-component MDS ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component IAU ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component IAU_APPEND ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component IAU_VIEWER ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component OPSS ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component WLS ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component UCSCC ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} "
          $components_passwords = [$rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password]
        }
        default: {
          $components = "-component MDS ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component IAU ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component IAU_APPEND ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component IAU_VIEWER ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component OPSS ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component WLS ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component STB ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} "
          $components_passwords = [$rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password]
        }
      }
    }
    'soa': {
      case $version {
        1036, 1111, 1211, 1212, 1213: {
          $components = "-component MDS ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component IAU ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component IAU_APPEND ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component IAU_VIEWER ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component OPSS ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component WLS ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component UCSCC ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component UCSUMS ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component UMS ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component ESS ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component SOAINFRA ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component MFT ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} "
          $components_passwords = [$rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password]
        }
        default: {
          $components = "-component MDS ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component IAU ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component IAU_APPEND ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component IAU_VIEWER ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component OPSS ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component WLS ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component STB ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component UCSUMS ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component ESS ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component SOAINFRA ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} "
          $components_passwords = [$rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password]
        }
      }
    }
    'mft': {
      $components = "-component MDS ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component IAU ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component IAU_APPEND ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component IAU_VIEWER ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component OPSS ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component WLS ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component UCSCC ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component MFT ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component UCSUMS ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component ESS ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} "
      $components_passwords = [$rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password]
    }
    'bip': {
      $components = "-component MDS ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component IAU ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component IAU_APPEND ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component IAU_VIEWER ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component OPSS ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component WLS ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component STB ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} -component BIPLATFORM ${rcu_temp_tablespace_cmd} ${$rcu_tablespace_cmd} "
      $components_passwords = [$rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password]
    }
    default: {
      fail("Unrecognized FMW fmw_product ${fmw_product}")
    }
  }

  easy_type::debug_evaluation() # Show local variable on extended debug

  file { "${download_dir}/rcu_passwords_${fmw_product}_${rcu_action}_${rcu_prefix}.txt":
    ensure    => file,
    content   => epp('wls_install/utils/rcu_passwords.txt.epp', {
        'rcu_sys_password'     => $rcu_sys_password,
        'components_passwords' => $components_passwords,
    }),
    mode      => '0600',
    owner     => $os_user,
    group     => $os_group,
    backup    => false,
    show_diff => false,
    before    => Wls_rcu[$rcu_prefix],
  }

  unless ( defined(File["${download_dir}/checkrcu.py"]) ) {
    file { "${download_dir}/checkrcu.py":
      ensure    => file,
      source    => 'puppet:///modules/wls_install/wlst/checkrcu.py',
      mode      => '0775',
      owner     => $os_user,
      group     => $os_group,
      backup    => false,
      show_diff => false,
      before    => Wls_rcu[$rcu_prefix],
    }
  }

  if ( $rcu_action == 'create' ) {
    $action = '-createRepository'
    $omf = $honor_omf
  } else {
    $action = '-dropRepository'
    $omf = ''
  }

  wls_rcu { $rcu_prefix:
    ensure       => $rcu_action,
    statement    => "${oracle_fmw_product_home_dir}/bin/rcu -silent ${action} -databaseType ORACLE -connectString ${rcu_database_url} -dbUser ${rcu_sys_user}${dba_role} ${soa_profile} -schemaPrefix ${rcu_prefix} ${components} ${omf} -f < ${download_dir}/rcu_passwords_${fmw_product}_${rcu_action}_${rcu_prefix}.txt",
    os_user      => $os_user,
    oracle_home  => $oracle_fmw_product_home_dir,
    sys_user     => $rcu_sys_user,
    sys_password => $rcu_sys_password.unwrap,
    jdbc_url     => $rcu_jdbc_url,
    jdk_home_dir => $jdk_home_dir,
    as_sysdba    => if $rcu_as_sysdba { 'yes' } else { 'no' },
    check_script => "${download_dir}/checkrcu.py",
  }

  cleanup { ["${download_dir}/rcu_passwords_${fmw_product}_${rcu_action}_${rcu_prefix}.txt","${download_dir}/checkrcu.py"]: }
}