Defined Type: oradb::rcu

Defined in:
manifests/rcu.pp

Overview

rcu

11g repository creation utility for soa suite, webcenter

Examples:

soa rcu


oradb::rcu{'DEV_PS6':
  rcu_file       => 'ofm_rcu_linux_11.1.1.7.0_32_disk1_1of1.zip',
  product        => 'soasuite',
  version        => '11.1.1.7',
  oracle_home    => '/oracle/product/11.2/db',
  user           => 'oracle',
  group          => 'dba',
  download_dir   => '/install',
  action         => 'create',
  db_server      => 'dbagent1.alfa.local:1521',
  db_service     => 'test.oracle.com',
  sys_password   => 'Welcome01',
  schema_prefix  => 'DEV',
  repos_password => 'Welcome02',
}

Parameters:

  • version (String) (defaults to: '11.1.1.7')

    Oracle installation version

  • rcu_file (String) (defaults to: undef)

    filename of the installation software

  • oracle_home (Optional[String]) (defaults to: undef)

    full path to the Oracle Home directory inside Oracle Base

  • user (String) (defaults to: lookup('oradb::user'))

    operating system user

  • group (String) (defaults to: lookup('oradb::group'))

    the operating group name for using the oracle software

  • puppet_download_mnt_point (String) (defaults to: lookup('oradb::module_mountpoint'))

    the location where the installation software is available

  • remote_file (Boolean) (defaults to: true)

    the installation is remote accessiable or not

  • product (Enum['soasuite', 'webcenter', 'oam', 'oim', 'all']) (defaults to: 'soasuite')

    kind of rcu, for which oracle product

  • log_output (Boolean) (defaults to: false)

    log all output

  • download_dir (String) (defaults to: lookup('oradb::download_dir'))

    location for installation files used by this module

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

    rcu action on the database

  • db_server (String) (defaults to: undef)

    the database server

  • db_service (String) (defaults to: undef)

    the database service name

  • sys_user (String) (defaults to: 'sys')

    the sys username

  • sys_password (String) (defaults to: undef)

    the sys username password

  • schema_prefix (String) (defaults to: undef)

    prefix of the rcu schemas

  • repos_password (String) (defaults to: undef)

    the rcu schemas password

  • temp_tablespace (Optional[String]) (defaults to: undef)

    shared temp tablespace used by the rcu schemas



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
83
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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# File 'manifests/rcu.pp', line 43

define oradb::rcu(
  String $rcu_file                                            = undef,
  Enum['soasuite', 'webcenter', 'oam', 'oim', 'all'] $product = 'soasuite',
  String $version                                             = '11.1.1.7',
  Optional[String] $oracle_home                               = undef,
  String $user                                                = lookup('oradb::user'),
  String $group                                               = lookup('oradb::group'),
  String $download_dir                                        = lookup('oradb::download_dir'),
  Enum['delete', 'create'] $action                            = 'create',
  String $db_server                                           = undef,
  String $db_service                                          = undef,
  String $sys_user                                            = 'sys',
  String $sys_password                                        = undef,
  String $schema_prefix                                       = undef,
  String $repos_password                                      = undef,
  Optional[String] $temp_tablespace                           = undef,
  String $puppet_download_mnt_point                           = lookup('oradb::module_mountpoint'),
  Boolean $remote_file                                        = true,
  Boolean $log_output                                         = false,
){
  $exec_path = lookup('oradb::exec_path')

  # create the rcu folder
  if ! defined(File["${download_dir}/rcu_${version}"]) {
    # check rcu install folder
    file { "${download_dir}/rcu_${version}":
      ensure  => directory,
      path    => "${download_dir}/rcu_${version}",
      recurse => false,
      replace => false,
      mode    => '0775',
      owner   => $user,
      group   => $group,
    }
  }

  # unzip rcu software
  if $remote_file == true {
    if ! defined(File["${download_dir}/${rcu_file}"]) {
      file { "${download_dir}/${rcu_file}":
        ensure => present,
        mode   => '0775',
        owner  => $user,
        group  => $group,
        source => "${puppet_download_mnt_point}/${rcu_file}",
        before => Exec["extract ${rcu_file}"],
      }
    }
    $source = $download_dir
  } else {
    $source = $puppet_download_mnt_point
  }

  if ! defined(Exec["extract ${rcu_file}"]) {
    exec { "extract ${rcu_file}":
      command   => "unzip -o ${source}/${rcu_file} -d ${download_dir}/rcu_${version}",
      creates   => "${download_dir}/rcu_${version}/rcuHome",
      path      => $exec_path,
      user      => $user,
      group     => $group,
      logoutput => $log_output,
    }
  }

  # rcuHome is read only for non-root user so put log dir above it
  if ! defined(File["${download_dir}/rcu_${version}/log"]) {
    # check rcu log folder
    file { "${download_dir}/rcu_${version}/log":
      ensure  => directory,
      path    => "${download_dir}/rcu_${version}/log",
      recurse => false,
      replace => false,
      require => Exec["extract ${rcu_file}"],
      mode    => '0775',
      owner   => $user,
      group   => $group,
    }
  }

  if $product == 'soasuite' {
    $components           = '-component SOAINFRA -component ORASDPM -component MDS -component OPSS -component BAM'
    $components_passwords = [$repos_password, $repos_password, $repos_password,$repos_password,$repos_password]
  } elsif $product == 'webcenter' {
    $components           = '-component MDS -component OPSS -component CONTENTSERVER11 -component CONTENTSERVER11SEARCH -component URM -component PORTLET -component WEBCENTER -component ACTIVITIES -component DISCUSSIONS'
    # extra password for DISCUSSIONS and ACTIVITIES
    $components_passwords = [$repos_password, $repos_password, $repos_password, $repos_password, $repos_password, $repos_password, $repos_password, $repos_password, $repos_password, $repos_password, $repos_password]
  } elsif $product == 'oam' {
    $components           = '-component MDS -component OPSS -component IAU -component OAM'
    $components_passwords = [$repos_password, $repos_password, $repos_password, $repos_password, $repos_password]
  } elsif $product == 'oim' {
    $components           = '-component SOAINFRA -component ORASDPM -component MDS -component OPSS -component BAM -component IAU -component BIPLATFORM -component OIF -component OIM -component OAM -component OAAM -component OMSM'
    $components_passwords = [$repos_password, $repos_password, $repos_password,$repos_password,$repos_password,$repos_password, $repos_password, $repos_password,$repos_password, $repos_password, $repos_password, $repos_password]
  } elsif $product == 'all' {
    $components           = '-component SOAINFRA -component ORASDPM -component MDS -component OPSS -component BAM -component CONTENTSERVER11 -component CONTENTSERVER11SEARCH -component URM -component PORTLET -component WEBCENTER -component ACTIVITIES -component DISCUSSIONS'
    # extra password for DISCUSSIONS and ACTIVITIES
    $components_passwords = [ $repos_password, $repos_password, $repos_password,$repos_password,$repos_password, $repos_password, $repos_password, $repos_password, $repos_password, $repos_password, $repos_password, $repos_password, $repos_password, $repos_password]
  } else {
    fail('Unrecognized FMW product')
  }

  file { "${download_dir}/rcu_${version}/rcu_passwords_${title}.txt":
    ensure  => present,
    require => Exec["extract ${rcu_file}"],
    content => epp('oradb/rcu_passwords.txt.epp',
                    { 'sys_password'        => $sys_password,
                      'componentsPasswords' => $components_passwords } ),
    mode    => '0775',
    owner   => $user,
    group   => $group,
  }

  if ( $oracle_home != undef ) {
    $pre_command    = "export SQLPLUS_HOME=${oracle_home};export RCU_LOG_LOCATION=${download_dir}/rcu_${version}/log;${download_dir}/rcu_${version}/rcuHome/bin/rcu -silent"
  } else {
    $pre_command    = "export RCU_LOG_LOCATION=${download_dir}/rcu_${version}/log;${download_dir}/rcu_${version}/rcuHome/bin/rcu -silent"
  }
  $post_command     = "-databaseType ORACLE -connectString ${db_server}:${db_service} -dbUser ${sys_user} -dbRole SYSDBA -schemaPrefix ${schema_prefix} ${components} "
  $password_command = " -f < ${download_dir}/rcu_${version}/rcu_passwords_${title}.txt"

  #optional set the Temp tablespace
  if $temp_tablespace == undef {
    $create_command  = "${pre_command} -createRepository ${post_command} ${password_command}"
  } else {
    $create_command  = "${pre_command} -createRepository ${post_command} -tempTablespace ${temp_tablespace} ${password_command}"
  }
  $delete_command  = "${pre_command} -dropRepository ${post_command} ${password_command}"

  if $action == 'create' {
    $statement = $create_command
  }
  elsif $action == 'delete' {
    $statement = $delete_command
  }

  db_rcu{ $schema_prefix:
    ensure       => $action,
    statement    => $statement,
    os_user      => $user,
    oracle_home  => $oracle_home,
    sys_user     => $sys_user,
    sys_password => $sys_password,
    db_server    => $db_server,
    db_service   => $db_service,
    require      => [Exec["extract ${rcu_file}"],
                    File["${download_dir}/rcu_${version}/rcu_passwords_${title}.txt"],],
  }

}