Defined Type: orawls::utils::rcu

Defined in:
manifests/utils/rcu.pp

Overview

utils::rcu define

rcu repository creation utility for 12c

Parameters:

  • version (Integer) (defaults to: $::orawls::weblogic::version)

    used weblogic software like 1036

  • jdk_home_dir (String) (defaults to: $::orawls::weblogic::jdk_home_dir)

    full path to the java home directory like /usr/java/default

  • os_user (String) (defaults to: $::orawls::weblogic::os_user)

    the user name with oracle as default

  • os_group (String) (defaults to: $::orawls::weblogic::os_group)

    the group name with dba as default

  • log_output (Boolean) (defaults to: $::orawls::weblogic::log_output)

    show all the output of the the exec actions

  • download_dir (String) (defaults to: $::orawls::weblogic::download_dir)

    the directory for temporary created files by this class

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

    product for which to create a RCU reposority for

  • oracle_fmw_product_home_dir (String) (defaults to: undef)

    path of the rcu command

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

    create or delete a repository

  • rcu_jdbc_url (String) (defaults to: undef)

    jdbc url to the RCU database server

  • rcu_database_url (String) (defaults to: undef)

    rcu database url

  • rcu_prefix (String) (defaults to: undef)

    RCU prefix

  • rcu_password (String) (defaults to: undef)

    rcu schema password

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

    rcu sys schema username

  • rcu_sys_password (String) (defaults to: undef)

    rcu sys username password



22
23
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
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
# File 'manifests/utils/rcu.pp', line 22

define orawls::utils::rcu(
  Integer $version                       = $::orawls::weblogic::version,
  Enum['adf','soa','mft'] $fmw_product   = 'adf',
  String $oracle_fmw_product_home_dir    = undef,
  String $jdk_home_dir                   = $::orawls::weblogic::jdk_home_dir,
  String $os_user                        = $::orawls::weblogic::os_user,
  String $os_group                       = $::orawls::weblogic::os_group,
  String $download_dir                   = $::orawls::weblogic::download_dir,
  Boolean $log_output                    = $::orawls::weblogic::log_output,
  Enum['create','delete'] $rcu_action    = 'create',
  String $rcu_jdbc_url                   = undef,   #jdbc...
  String $rcu_database_url               = undef,   #192.168.50.5:1521:XE
  String $rcu_prefix                     = undef,
  String $rcu_password                   = undef,
  String $rcu_sys_user                   = 'sys',
  String $rcu_sys_password               = undef,
){

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

  if $fmw_product == 'adf' {
    if $version >= 1221 {
      $components = '-component MDS -component IAU -component IAU_APPEND -component IAU_VIEWER -component OPSS -component WLS -component STB '
      $componentsPasswords = [$rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password]
    }
    else {
      $components = '-component MDS -component IAU -component IAU_APPEND -component IAU_VIEWER -component OPSS -component WLS -component UCSCC '
      $componentsPasswords = [$rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password]
    }
  }
  elsif $fmw_product == 'soa' {
    if $version >= 1221 {
      $components = '-component MDS -component IAU -component IAU_APPEND -component IAU_VIEWER -component OPSS -component WLS -component STB -component UCSUMS -component ESS -component SOAINFRA '
      $componentsPasswords = [$rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password]
    }
    else {
      $components = '-component MDS -component IAU -component IAU_APPEND -component IAU_VIEWER -component OPSS -component WLS -component UCSCC -component UCSUMS -component UMS -component ESS -component SOAINFRA -component MFT '
      $componentsPasswords = [$rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password]
    }
  }
  elsif $fmw_product == 'mft' {
    $components = '-component MDS -component IAU -component IAU_APPEND -component IAU_VIEWER -component OPSS -component WLS -component UCSCC -component MFT -component UCSUMS -component ESS'
    $componentsPasswords = [$rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password, $rcu_password]
  } else {
    fail('Unrecognized FMW fmw_product')
  }

  file { "${download_dir}/rcu_passwords_${fmw_product}_${rcu_action}_${rcu_prefix}.txt":
    ensure  => present,
    content => template('orawls/utils/rcu_passwords.txt.erb'),
    mode    => lookup('orawls::permissions_secret'),
    owner   => $os_user,
    group   => $os_group,
    backup  => false,
    before  => Wls_rcu[$rcu_prefix],
  }

  if !defined(File["${download_dir}/checkrcu.py"]) {
    file { "${download_dir}/checkrcu.py":
      ensure => present,
      source => 'puppet:///modules/orawls/wlst/checkrcu.py',
      mode   => lookup('orawls::permissions'),
      owner  => $os_user,
      group  => $os_group,
      backup => false,
      before => Wls_rcu[$rcu_prefix],
    }
  }

  if $rcu_action == 'create' {
    $action = '-createRepository'
  }
  elsif $rcu_action == 'delete' {
    $action = '-dropRepository'
  }

  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} -dbRole SYSDBA -schemaPrefix ${rcu_prefix} ${components} -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,
    jdbc_url     => $rcu_jdbc_url,
    jdk_home_dir => $jdk_home_dir,
    check_script => "${download_dir}/checkrcu.py",
  }
}