Defined Type: orawls::storeuserconfig

Defined in:
manifests/storeuserconfig.pp

Overview

storeuserconfig define

Will store the weblogic credentials on the VM so it can be used by others operations without providing the credentials

Examples:

Declaring the class

orawls::storeuserconfig{'domainA':
  domain_name               => 'domainA',
  user_config_dir           => '/home/oracle',
  weblogic_password         => 'weblogic1',
}

Parameters:

  • domain_name (String) (defaults to: undef)

    the domain name which to connect to

  • adminserver_address (String) (defaults to: 'localhost')

    the adminserver network name or ip

  • adminserver_port (Integer) (defaults to: 7001)

    the adminserver port number

  • user_config_dir (String) (defaults to: undef)

    the full path to write the userconfig credentials

  • weblogic_user (String) (defaults to: 'weblogic')

    the weblogic administrator username

  • weblogic_password (String) (defaults to: undef)

    the weblogic domain password

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

    directory of the WebLogic software inside the middleware directory

  • 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

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

    the directory for temporary created by this class

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

    show all the output of the the exec actions



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
# File 'manifests/storeuserconfig.pp', line 26

define orawls::storeuserconfig (
  String $domain_name         = undef,
  String $weblogic_home_dir   = $::orawls::weblogic::weblogic_home_dir,
  String $jdk_home_dir        = $::orawls::weblogic::jdk_home_dir,
  String $adminserver_address = 'localhost',
  Integer $adminserver_port   = 7001,
  String $user_config_dir     = undef,
  String $weblogic_user       = 'weblogic',
  String $weblogic_password   = undef,
  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,
)
{
  # the py script used by the wlst*-
  file { "${download_dir}/${title}storeUserConfig.py":
    ensure  => present,
    path    => "${download_dir}/${title}storeUserConfig.py",
    content => epp('orawls/wlst/storeUserConfig.py.epp', {
                    'weblogic_user'       => $weblogic_user,
                    'adminserver_address' => $adminserver_address,
                    'adminserver_port'    => $adminserver_port,
                    'domain_name'         => $domain_name,
                    'os_user'             => $os_user,
                    'user_config_dir'     => $user_config_dir }),
    backup  => false,
    replace => true,
    mode    => '0555',
    owner   => $os_user,
    group   => $os_group,
  }

  $javaCommand = 'java -Dweblogic.management.confirmKeyfileCreation=true -Dweblogic.security.SSL.ignoreHostnameVerification=true weblogic.WLST -skipWLSModuleScanning '
  $exec_path = "${jdk_home_dir}/bin:${lookup('orawls::exec_path')}"

  exec { "execwlst ${title}storeUserConfig.py":
    command     => "${javaCommand} ${download_dir}/${title}storeUserConfig.py ${weblogic_password}",
    environment => ["CLASSPATH=${weblogic_home_dir}/server/lib/weblogic.jar", "JAVA_HOME=${jdk_home_dir}"],
    unless      => "ls -l ${user_config_dir}/${os_user}-${domain_name}-WebLogicConfig.properties",
    path        => $exec_path,
    user        => $os_user,
    group       => $os_group,
    logoutput   => $log_output,
    require     => File["${download_dir}/${title}storeUserConfig.py"],
  }

}