coi-gov-pl / puppet-jboss

Installs JBoss EAP and WildFly application servers and manage their resources and applications in either a domain or a stand-alone mode
Apache License 2.0
15 stars 8 forks source link

Add define jboss::cliexec that can execute any JBoss custom methods for any CLI path #42

Open cardil opened 8 years ago

cardil commented 8 years ago

This feature request describes new define: jboss::cliexec.

Description for Wiki (draft):

WIKI CUT HERE

The jboss::cliexec defined type

This define is very versatile. It can be used to execute any JBoss CLI method for any CLI path. This define also supports parameters onlyif and unless. One of them must be present to prevent idempotent issues, they should work similar to ones defined in Puppet build-in resource exec.

jboss::cliexec { '/subsystem=jgroups/stack=udp:add-protocol(type=PING)':
  unless => '/subsystem=jgroups/stack=udp/protocol=PING:read-resource',
}

Parameters of jboss::cliexec:

This type uses JBoss module standard metaparameters

unless parameter

The unless parameter can be used to check if resource should be executed. If passed command fails that means that it should be run. You must pass unless if not passing onlyif and only one of them can be set for given resource. Example:

jboss::cliexec { '/subsystem=jgroups/stack=udp:add-protocol(type=PING)':
  unless => '/subsystem=jgroups/stack=udp/protocol=PING:read-resource',
}

onlyif parameter

The onlyif parameter can be used to check if resource should be executed. If passed command succeds that means that it should be run. You must pass onlyif if not passing unless and only one of them can be set for given resource Example:

jboss::cliexec { '/subsystem=jgroups/stack=udp:remove-protocol(type=PING)':
  onlyif => '/subsystem=jgroups/stack=udp/protocol=PING:read-resource',
}

command parameter

This is the namevar. Command to be executed as full CLI entry and method. The command must be passed without /profile=<profile-name> in domain mode as well (for that profile parameter must be used).

basepath parameter

The base path can be used to shorten recurring paths in commands. Example:

jboss::cliexec { ':remove-protocol(type=PING)':
  onlyif   => '/protocol=PING:read-resource',
  basepath => '/subsystem=jgroups/stack=udp',
}

WIKI CUT HERE

Scope of change for this feature:

cardil commented 8 years ago

This feature will give users a way to run any JBoss commands, like in question #38

Cosaquee commented 8 years ago

First of all we need to merge #10 imho.

cardil commented 8 years ago

Yup @Cosaquee. This should be at least v1.1.0 or later