Defined Type: orawls::oud::control

Defined in:
manifests/oud/control.pp

Overview

oud::control define

start or stop an Oracle Unified Directory LDAP instance

Parameters:

  • 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

  • oud_instances_home_dir (String) (defaults to: undef)

    base location of the OUD instances

  • oud_instance_name (String) (defaults to: undef)

    name of the OUD instance

  • action (Enum['start','stop']) (defaults to: 'start')

    stop or start the OUD instance



13
14
15
16
17
18
19
20
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
# File 'manifests/oud/control.pp', line 13

define orawls::oud::control(
  String $oud_instances_home_dir               = undef,
  String $oud_instance_name                    = undef,
  Enum['start','stop'] $action                 = 'start',
  String $os_user                              = $::orawls::weblogic::os_user,
  String $os_group                             = $::orawls::weblogic::os_group,
  Boolean $log_output                          = $::orawls::weblogic::log_output,
){

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

  case $facts['kernel'] {
    'Linux': {
      $checkCommand = "/bin/ps -ef | grep -v grep | /bin/grep '${oud_instances_home_dir}/${oud_instance_name}/OUD'"
    }
    'SunOS': {
      case $facts['kernelrelease'] {
        '5.11': {
          $checkCommand = "/bin/ps wwxa | /bin/grep -v grep | /bin/grep '${oud_instances_home_dir}/${oud_instance_name}/OUD'"
        }
        default: {
          $checkCommand = "/usr/ucb/ps wwxa | /bin/grep -v grep | /bin/grep '${oud_instances_home_dir}/${oud_instance_name}/OUD'"
        }
      }
    }
    default: {
      fail("Unrecognized operating system ${::kernel}, please use it on a Linux or Solaris host")
    }
  }

  if $action == 'start' {
    exec { "start oud ${title}":
      command   => "${oud_instances_home_dir}/${oud_instance_name}/OUD/bin/start-ds",
      unless    => $checkCommand,
      path      => $exec_path,
      user      => $os_user,
      group     => $os_group,
      timeout   => 0,
      logoutput => $log_output,
    }
  } else {
    exec { "stop oud ${title}":
      command   => "${oud_instances_home_dir}/${oud_instance_name}/OUD/bin/stop-ds",
      onlyif    => $checkCommand,
      path      => $exec_path,
      user      => $os_user,
      group     => $os_group,
      timeout   => 0,
      logoutput => $log_output,
    }
  }
}