Defined Type: orawls::oud::instance

Defined in:
manifests/oud/instance.pp

Overview

oud::instance

create an Oracle Unified Directory LDAP instance

Parameters:

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

    used weblogic software like 1036

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

    directory of the Oracle software inside the oracle base directory

  • 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

  • oud_home (String) (defaults to: undef)

    OUD Home directory

  • oud_instance_name (String) (defaults to: undef)

    OUD instance name

  • oud_root_user_password (String) (defaults to: undef)

    OUD LDAP root password

  • oud_base_dn (String) (defaults to: 'dc=example,dc=com')

    LDAP base dn name

  • oud_ldap_port (Integer) (defaults to: 1389)

    ldap port

  • oud_admin_connector_port (Integer) (defaults to: 4444)

    admin port

  • oud_ldaps_port (Integer) (defaults to: 1636)

    secure LDAP port

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

    base directory of the oracle installation, it will contain the default Oracle inventory and the middleware home



21
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
# File 'manifests/oud/instance.pp', line 21

define orawls::oud::instance (
  Integer $version                                        = $::orawls::weblogic::version,
  String $oracle_base_home_dir                            = $::orawls::weblogic::oracle_base_home_dir,
  String $middleware_home_dir                             = $::orawls::weblogic::middleware_home_dir,
  String $oud_home                                        = undef,
  String $oud_instance_name                               = undef,
  String $oud_root_user_password                          = undef,
  String $oud_base_dn                                     = 'dc=example,dc=com',
  Integer $oud_ldap_port                                  = 1389,
  Integer $oud_admin_connector_port                       = 4444,
  Integer $oud_ldaps_port                                 = 1636,
  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,
){

  $instances_home = "${oracle_base_home_dir}/oud_instances"

  if !defined(File[$instances_home]) {
    file { $instances_home:
      ensure  => directory,
      recurse => false,
      replace => false,
      mode    => lookup('orawls::permissions'),
      owner   => $os_user,
      group   => $os_group,
    }
  }

  $exec_path = lookup('orawls::exec_path')

  exec { "rootUserPasswordFile ${title}":
    command   => "echo ${oud_root_user_password} > ${instances_home}/${oud_instance_name}pass.txt",
    timeout   => 0,
    unless    => "test -d ${instances_home}/${oud_instance_name}",
    require   => File[$instances_home],
    path      => $exec_path,
    user      => $os_user,
    group     => $os_group,
    logoutput => true,
  }

  exec { "create ldap ${title}":
    command     => "${oud_home}/oud-setup --cli --baseDN ${oud_base_dn} --addBaseEntry --netsvc --ldapPort ${oud_ldap_port} --adminConnectorPort ${oud_admin_connector_port} --skipPortCheck --rootUserDN cn=Directory\\ Manager --rootUserPasswordFile ${instances_home}/${oud_instance_name}pass.txt --doNotStart --serverTuning autotune --importTuning autotune --enableStartTLS --ldapsPort ${oud_ldaps_port} --generateSelfSignedCertificate --hostName ${facts['fqdn']} --no-prompt --noPropertiesFile",
    timeout     => 0,
    environment => ["INSTANCE_NAME=../oud_instances/${oud_instance_name}"],
    unless      => "test -d ${instances_home}/${oud_instance_name}",
    require     => [File[$instances_home],Exec["rootUserPasswordFile ${title}"],],
    path        => $exec_path,
    user        => $os_user,
    group       => $os_group,
    logoutput   => true,
  }

  exec { "absent rootUserPasswordFile ${title}":
    command   => "rm ${instances_home}/${oud_instance_name}pass.txt",
    timeout   => 0,
    onlyif    => "test -f ${instances_home}/${oud_instance_name}pass.txt",
    require   => [Exec["create ldap ${title}"],Exec["rootUserPasswordFile ${title}"],],
    path      => $exec_path,
    user      => $os_user,
    group     => $os_group,
    logoutput => true,
  }
}