Overview

This resource allows you to execute a wlst command or script in the context.

This is a fallback resource. This means you should use it with care and only if there are no other Puppet types available. Here is an example on how you should use this:

wls_exec{'@/tmp/set_some_configuration.py'
  cwd         => '/tmp',
  refreshonly => true,
  logoutput   => true,
  unless      => '@/tmp/configuration_is_not_set.py',
}

This statement will first execute the /tmp/configuration_is_not_set.py script. If this script returns something, the main script (e.g. /tmp/set_some_configuration.py) will not be executed. If it returns nothing, the /tmp/set_some_configuration.py script is executed.

Here is an example of a part of the unless script:

if resource_available:
  print >>puppet, "resource unavailable" # This is the header for the conversion

If the resource is available, you must write something to puppet. If the resource is not available, do nothing.

Formatting

Because Python is sensitive for formatting, you should take care the formatting of the main and the unless scripts. You MUST start both scripts at column 0.

You can also explicitly specify the domain:

wls_exec{'my_domain/@/tmp/set_some_configuration.py'
  cwd         => '/tmp',
  refreshonly => true,
  logoutput   => true,
  unless      => '@/tmp/configuration_is_not_set.py',
}

Attributes

Attribute Name Short Description
cwd The default directory from where the scripts will be run.
domain With this parameter, you identify the domain, where your objects is in.
logoutput exit code.
name The name.
provider resource.
refreshonly refresh mechanism for when a dependent object is changed.
statement The wlst statement or script to execute
   
timeout Timeout for applying a resource.
unless A statement to determine if the wls_exec must execute or not.

cwd

The default directory from where the scripts will be run. If not specfied, this will be /tmp.

Back to overview of wls_exec

domain

With this parameter, you identify the domain, where your objects is in.

The domain name is part of the full qualified name of any WebLogic object on a system. Let’s say we want to describe a WebLogic server. The full qualified name is:

wls_server{'domain_name/server_name':
  ensure => present,
  ...
}

When you don’t specify a domain name, Puppet will use default as domain name. For every domain you want to manage, you’ll have to put a wls_settings in your manifest.

Back to overview of wls_exec

logoutput

Whether to log command output in addition to logging the exit code. Defaults to on_failure, which only logs the output when the command has an exit code that does not match any value specified by the returns attribute. As with any resource type, the log level can be controlled with the loglevel metaparameter.”

Valid values are true, false, on_failure. Back to overview of wls_exec

name

The name.

Back to overview of wls_exec

provider

The specific backend to use for this wls_exec resource. You will seldom need to specify this — Puppet will usually discover the appropriate provider for your platform.Available providers are:

sqlplus

Back to overview of wls_exec

refreshonly

The command should only be run as a refresh mechanism for when a dependent object is changed. It only makes sense to use this option when this command depends on some other object; it is useful for triggering an action:

Note that only subscribe and notify can trigger actions, not require, so it only makes sense to use refreshonly with subscribe or notify.

Valid values are true, false. Back to overview of wls_exec

statement

The wlst statement or script to execute

Back to overview of wls_exec

timeout

Timeout for applying a resource.

To be sure no Puppet operation, hangs a Puppet daemon, all operations have a timeout. When this timeout expires, Puppet will abort the current operation and signal an error in the Puppet run.

With this parameter, you can specify the length of the timeout. The value is specified in seconds. In this example, the timeout is set to 600 seconds.

wls_server{'my_server':
  ...
  timeout => 600,
}

The default value for timeout is 120 seconds.

Back to overview of wls_exec

unless

A statement to determine if the wls_exec must execute or not.

If the statement returns something,the wls_exec is NOT executed. If the statement returns nothing, the specified wls_exec statement IS executed.

The unless clause must be a valid WLST statement. An error in the query will result in a failure of the apply statement.

Back to overview of wls_exec