summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Mazzitelli <mazz@redhat.com>2009-10-03 10:51:58 -0400
committerJohn Mazzitelli <mazz@redhat.com>2009-10-03 10:51:58 -0400
commitf18dd5bed3639882ded33bf22c3346993905c67d (patch)
tree36714148256514487aefb19b43ef27365537d71f
parent2aee4a7c1e9ab20e3b64d0e827ca7ea1dd8e6801 (diff)
downloadpuppet-plugin-f18dd5bed3639882ded33bf22c3346993905c67d.tar.gz
puppet-plugin-f18dd5bed3639882ded33bf22c3346993905c67d.tar.xz
puppet-plugin-f18dd5bed3639882ded33bf22c3346993905c67d.zip
extend the script plugin so I can pick up its capabilities to get avail, discovery, version checkingHEADmaster
-rw-r--r--.classpath22
-rw-r--r--pom.xml351
-rw-r--r--src/main/java/org/rhq/plugins/puppet/PuppetComponent.java95
-rw-r--r--src/main/java/org/rhq/plugins/puppet/PuppetDiscovery.java139
-rw-r--r--src/main/resources/META-INF/rhq-plugin.xml30
5 files changed, 319 insertions, 318 deletions
diff --git a/.classpath b/.classpath
index ee6a949..8905a9b 100644
--- a/.classpath
+++ b/.classpath
@@ -1,10 +1,12 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src/main/java"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.1/commons-logging-1.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/rhq/rhq-core-domain/1.4.0-SNAPSHOT/rhq-core-domain-1.4.0-SNAPSHOT.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/rhq/rhq-core-plugin-api/1.4.0-SNAPSHOT/rhq-core-plugin-api-1.4.0-SNAPSHOT.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/rhq/rhq-core-native-system/1.4.0-SNAPSHOT/rhq-core-native-system-1.4.0-SNAPSHOT.jar"/>
- <classpathentry kind="output" path="eclipse-classes"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.1/commons-logging-1.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/rhq/rhq-core-domain/1.4.0-SNAPSHOT/rhq-core-domain-1.4.0-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/rhq/rhq-core-plugin-api/1.4.0-SNAPSHOT/rhq-core-plugin-api-1.4.0-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/rhq/rhq-core-native-system/1.4.0-SNAPSHOT/rhq-core-native-system-1.4.0-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/rhq/rhq-script-plugin/1.4.0-SNAPSHOT/rhq-script-plugin-1.4.0-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/javax/persistence/persistence-api/1.0/persistence-api-1.0.jar"/>
+ <classpathentry kind="output" path="eclipse-classes"/>
+</classpath>
diff --git a/pom.xml b/pom.xml
index 7710ebd..526a10f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,179 +1,174 @@
-<project
- xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
- >
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-plugins-parent</artifactId>
- <version>1.4.0-SNAPSHOT</version><!-- TODO adjust RHQ version -->
- </parent>
-
- <groupId>org.rhq</groupId>
- <artifactId>puppet-plugin</artifactId>
- <packaging>jar</packaging>
-
- <name>RHQ puppet Plugin</name>
- <description>Content push via puppet</description>
-
- <properties>
- <scm.module.path>TODO</scm.module.path>
- <rhq.version>1.4.0-SNAPSHOT</rhq.version> <!-- TODO adjust, see above too -->
- </properties>
-
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- </configuration>
- </plugin>
-
-
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>dev</id>
-
- <properties>
- <rhq.rootDir>../../..</rhq.rootDir>
- <rhq.containerDir>${rhq.rootDir}/${rhq.defaultDevContainerPath}</rhq.containerDir>
- <rhq.deploymentDir>${rhq.containerDir}/jbossas/server/default/deploy/${rhq.earName}/rhq-downloads/rhq-plugins</rhq.deploymentDir>
- </properties>
-
- <build>
- <plugins>
-
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <version>1.1</version>
- <executions>
-
- <execution>
- <id>deploy</id>
- <phase>compile</phase>
- <configuration>
- <tasks>
- <mkdir dir="${rhq.deploymentDir}"/>
- <property name="deployment.file"
- location="${rhq.deploymentDir}/${project.build.finalName}.jar"/>
- <echo>*** Updating ${deployment.file}...</echo>
- <jar destfile="${deployment.file}" basedir="${project.build.outputDirectory}"/>
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
-
- <execution>
- <id>deploy-jar-meta-inf</id>
- <phase>package</phase>
- <configuration>
- <tasks>
- <property name="deployment.file"
- location="${rhq.deploymentDir}/${project.build.finalName}.jar"/>
- <echo>*** Updating META-INF dir in ${deployment.file}...</echo>
- <unjar src="${project.build.directory}/${project.build.finalName}.jar"
- dest="${project.build.outputDirectory}">
- <patternset>
- <include name="META-INF/**"/>
- </patternset>
- </unjar>
- <jar destfile="${deployment.file}"
- manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF"
- update="true">
- </jar>
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
-
- <execution>
- <id>undeploy</id>
- <phase>clean</phase>
- <configuration>
- <tasks>
- <property name="deployment.file"
- location="${rhq.deploymentDir}/${project.build.finalName}.jar"/>
- <echo>*** Deleting ${deployment.file}...</echo>
- <delete file="${deployment.file}"/>
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
-
- </executions>
- </plugin>
-
- </plugins>
- </build>
-
- </profile>
- </profiles>
-
-
- <repositories>
- <repository>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- <id>jboss</id>
- <name>JBoss Repository</name>
- <url>http://repository.jboss.org/maven2/</url>
- </repository>
- <!-- TODO add your own maven repositories here (if needed) -->
- </repositories>
-
- <pluginRepositories>
- <pluginRepository>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- <id>jboss</id>
- <name>JBoss Plugin Repository</name>
- <url>http://repository.jboss.org/maven2/</url>
- </pluginRepository>
- </pluginRepositories>
-
-
- <dependencies>
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>1.1</version>
- </dependency>
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-core-domain</artifactId>
- <version>${rhq.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-core-plugin-api</artifactId>
- <version>${rhq.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-core-native-system</artifactId>
- <version>${rhq.version}</version>
- <scope>provided</scope>
- </dependency>
-
- <!-- TODO add your dependencies here -->
-
- </dependencies>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-plugins-parent</artifactId>
+ <version>1.4.0-SNAPSHOT</version><!-- TODO adjust RHQ version -->
+ </parent>
+
+ <groupId>org.rhq</groupId>
+ <artifactId>puppet-plugin</artifactId>
+ <packaging>jar</packaging>
+
+ <name>RHQ puppet Plugin</name>
+ <description>Content push via puppet</description>
+
+ <properties>
+ <scm.module.path>TODO</scm.module.path>
+ <rhq.version>1.4.0-SNAPSHOT</rhq.version> <!-- TODO adjust, see above too -->
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>dev</id>
+
+ <properties>
+ <rhq.rootDir>../../..</rhq.rootDir>
+ <rhq.containerDir>${rhq.rootDir}/${rhq.defaultDevContainerPath}</rhq.containerDir>
+ <rhq.deploymentDir>${rhq.containerDir}/jbossas/server/default/deploy/${rhq.earName}/rhq-downloads/rhq-plugins</rhq.deploymentDir>
+ </properties>
+
+ <build>
+ <plugins>
+
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.1</version>
+ <executions>
+
+ <execution>
+ <id>deploy</id>
+ <phase>compile</phase>
+ <configuration>
+ <tasks>
+ <mkdir dir="${rhq.deploymentDir}" />
+ <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar" />
+ <echo>*** Updating ${deployment.file}...</echo>
+ <jar destfile="${deployment.file}" basedir="${project.build.outputDirectory}" />
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+
+ <execution>
+ <id>deploy-jar-meta-inf</id>
+ <phase>package</phase>
+ <configuration>
+ <tasks>
+ <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar" />
+ <echo>*** Updating META-INF dir in ${deployment.file}...</echo>
+ <unjar src="${project.build.directory}/${project.build.finalName}.jar" dest="${project.build.outputDirectory}">
+ <patternset>
+ <include name="META-INF/**" />
+ </patternset>
+ </unjar>
+ <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF"
+ update="true">
+ </jar>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+
+ <execution>
+ <id>undeploy</id>
+ <phase>clean</phase>
+ <configuration>
+ <tasks>
+ <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar" />
+ <echo>*** Deleting ${deployment.file}...</echo>
+ <delete file="${deployment.file}" />
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+
+ </profile>
+ </profiles>
+
+
+ <repositories>
+ <repository>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ <id>jboss</id>
+ <name>JBoss Repository</name>
+ <url>http://repository.jboss.org/maven2/</url>
+ </repository>
+ <!-- TODO add your own maven repositories here (if needed) -->
+ </repositories>
+
+ <pluginRepositories>
+ <pluginRepository>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ <id>jboss</id>
+ <name>JBoss Plugin Repository</name>
+ <url>http://repository.jboss.org/maven2/</url>
+ </pluginRepository>
+ </pluginRepositories>
+
+
+ <dependencies>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-domain</artifactId>
+ <version>${rhq.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-plugin-api</artifactId>
+ <version>${rhq.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-native-system</artifactId>
+ <version>${rhq.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-script-plugin</artifactId>
+ <version>${rhq.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ </dependencies>
</project> \ No newline at end of file
diff --git a/src/main/java/org/rhq/plugins/puppet/PuppetComponent.java b/src/main/java/org/rhq/plugins/puppet/PuppetComponent.java
index 5dcd657..b311f98 100644
--- a/src/main/java/org/rhq/plugins/puppet/PuppetComponent.java
+++ b/src/main/java/org/rhq/plugins/puppet/PuppetComponent.java
@@ -1,112 +1,47 @@
-
package org.rhq.plugins.puppet;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.core.pluginapi.inventory.CreateChildResourceFacet;
import org.rhq.core.pluginapi.inventory.CreateResourceReport;
import org.rhq.core.pluginapi.inventory.DeleteResourceFacet;
import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
import org.rhq.core.pluginapi.inventory.ResourceComponent;
-import org.rhq.core.pluginapi.inventory.ResourceContext;
-import org.rhq.core.pluginapi.operation.OperationContext;
import org.rhq.core.pluginapi.operation.OperationFacet;
import org.rhq.core.pluginapi.operation.OperationResult;
+import org.rhq.core.system.ProcessExecutionResults;
+import org.rhq.core.system.SystemInfo;
+import org.rhq.plugins.script.ScriptServerComponent;
-
-public class PuppetComponent implements ResourceComponent
-, OperationFacet
-, CreateChildResourceFacet
-, DeleteResourceFacet
-{
+public class PuppetComponent extends ScriptServerComponent implements ResourceComponent, OperationFacet, CreateChildResourceFacet,
+ DeleteResourceFacet {
+
private final Log log = LogFactory.getLog(this.getClass());
- private static final int CHANGEME = 1; // TODO remove or change this
-
-
-
-
- /**
- * Return availability of this resource
- * @see ResourceComponent#getAvailability()
- */
- public AvailabilityType getAvailability() {
- // TODO supply real implementation
- return AvailabilityType.UP;
- }
-
-
- /**
- * Start the resource connection
- * @see org.rhq.core.pluginapi.inventory.ResourceComponent#start(org.rhq.core.pluginapi.inventory.ResourceContext)
- */
- public void start(ResourceContext context) throws InvalidPluginConfigurationException, Exception {
-
- Configuration conf = context.getPluginConfiguration();
- // TODO add code to start the resource / connection to it
-
-
- }
-
-
- /**
- * Tear down the rescource connection
- * @see org.rhq.core.pluginapi.inventory.ResourceComponent#stop()
- */
- public void stop() {
-
+ // these are reused from our generic script plugin
+ protected static final String PLUGINCONFIG_EXECUTABLE = ScriptServerComponent.PLUGINCONFIG_EXECUTABLE;
- }
-
-
-
-
-
- public void startOperationFacet(OperationContext context) {
-
- }
-
-
- /**
- * Invokes the passed operation on the managed resource
- * @param name Name of the operation
- * @param params The method parameters
- * @return An operation result
- * @see org.rhq.core.pluginapi.operation.OperationFacet
- */
public OperationResult invokeOperation(String name, Configuration params) throws Exception {
+ // TODO
OperationResult res = new OperationResult();
if ("dummyOperation".equals(name)) {
- // TODO implement me
-
}
return res;
}
-
-
- /**
- * Create a child resource
- * @see org.rhq.core.pluginapi.inventory.CreateChildResourceFacet
- */
- public CreateResourceReport createResource(CreateResourceReport report)
- {
- // TODO supply code to create a child resource
-
+ public CreateResourceReport createResource(CreateResourceReport report) {
return null; // TODO change this
}
- /**
- * Delete a child resource
- * @see org.rhq.core.pluginapi.inventory.DeleteResourceFacet
- */
- public void deleteResource() throws Exception
- {
+ public void deleteResource() throws Exception {
// TODO supply code to delete a child resource
}
+ protected static ProcessExecutionResults executeExecutable(SystemInfo sysInfo, Configuration pluginConfig,
+ String args, long wait, boolean captureOutput) throws InvalidPluginConfigurationException {
+ return ScriptServerComponent.executeExecutable(sysInfo, pluginConfig, args, wait, captureOutput);
+ }
}
diff --git a/src/main/java/org/rhq/plugins/puppet/PuppetDiscovery.java b/src/main/java/org/rhq/plugins/puppet/PuppetDiscovery.java
index 4a10f66..fb0133c 100644
--- a/src/main/java/org/rhq/plugins/puppet/PuppetDiscovery.java
+++ b/src/main/java/org/rhq/plugins/puppet/PuppetDiscovery.java
@@ -1,46 +1,95 @@
-package org.rhq.plugins.puppet;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
-import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
-import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
-
-
-/**
- * Discovery class
- */
-public class PuppetDiscovery implements ResourceDiscoveryComponent {
-
-
- private final Log log = LogFactory.getLog(this.getClass());
-
-
- /**
- * Run the discovery
- */
- public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext discoveryContext) throws Exception {
-
- Set<DiscoveredResourceDetails> discoveredResources = new HashSet<DiscoveredResourceDetails>();
-
- /**
- * TODO: do your discovery here
- * A discovered resource must have a unique key, that must
- * stay the same when the resource is discovered the next
- * time
- */
- DiscoveredResourceDetails detail = null; // new DiscoveredResourceDetails( );
-
-
- // Add to return values
- discoveredResources.add(detail);
- log.info("Discovered new ... TODO "); // TODO change
-
- return discoveredResources;
-
- }
+package org.rhq.plugins.puppet;
+
+import java.io.File;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+import org.rhq.core.system.ProcessExecution;
+import org.rhq.core.system.ProcessExecutionResults;
+import org.rhq.core.system.SystemInfo;
+import org.rhq.plugins.script.ScriptDiscoveryComponent;
+
+/**
+ * Puppet client discovery class.
+ */
+public class PuppetDiscovery extends ScriptDiscoveryComponent implements ResourceDiscoveryComponent {
+
+ private final Log log = LogFactory.getLog(this.getClass());
+
+ @Override
+ public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext discoveryContext) {
+
+ String executable = checkExecutables(discoveryContext.getSystemInformation());
+
+ // if null, it means puppet is not installed or we could not auto-detect its location
+ if (executable == null) {
+ return new HashSet<DiscoveredResourceDetails>();
+ }
+
+ // create our plugin config with the executable path, and use the manual-add facet to create our details
+ Configuration pluginConfig = discoveryContext.getDefaultPluginConfiguration();
+ pluginConfig.put(new PropertySimple(PuppetComponent.PLUGINCONFIG_EXECUTABLE, executable));
+
+ Set<DiscoveredResourceDetails> discoveredResources = new HashSet<DiscoveredResourceDetails>();
+ DiscoveredResourceDetails details = discoverResource(pluginConfig, discoveryContext);
+ if (details != null) {
+ discoveredResources.add(details);
+ }
+
+ return discoveredResources;
+ }
+
+ @Override
+ public DiscoveredResourceDetails discoverResource(Configuration config, ResourceDiscoveryContext context) {
+ DiscoveredResourceDetails details = super.discoverResource(config, context);
+ if (details != null) {
+ details.setResourceName("Puppet Client");
+ log.info("Discovered new puppet client at ["
+ + config.getSimpleValue(PuppetComponent.PLUGINCONFIG_EXECUTABLE, "?") + "]");
+ }
+ return details;
+ }
+
+ @Override
+ protected String determineDescription(ResourceDiscoveryContext context, Configuration pluginConfig) {
+ return "Puppet client that applies recipes to the system";
+ }
+
+ private String checkExecutables(SystemInfo systemInfo) {
+ // Make sure puppet is actually on the system
+ // First we see if its in a typical place.
+ String[] executables = new String[] { "/usr/bin/puppet", "/bin/puppet" };
+ for (String executable : executables) {
+ File file = new File(executable);
+ if (file.canRead()) {
+ return executable;
+ }
+ }
+
+ // We can't find it, use 'which' to see if it knows
+ String executable = null;
+
+ try {
+ ProcessExecution processExecution = new ProcessExecution("which");
+ processExecution.setArguments(new String[] { "puppet" });
+ processExecution.setCaptureOutput(true);
+
+ ProcessExecutionResults executionResults = systemInfo.executeProcess(processExecution);
+ String capturedOutput = executionResults.getCapturedOutput();
+ executable = (((capturedOutput == null) || "".equals(capturedOutput)) ? null : capturedOutput.trim());
+ } catch (Exception e) {
+ log.debug("'which' failed to determine where the puppet executable is. Cause: " + e);
+ }
+
+ return executable;
+ }
} \ No newline at end of file
diff --git a/src/main/resources/META-INF/rhq-plugin.xml b/src/main/resources/META-INF/rhq-plugin.xml
index a1124d7..955a09d 100644
--- a/src/main/resources/META-INF/rhq-plugin.xml
+++ b/src/main/resources/META-INF/rhq-plugin.xml
@@ -6,18 +6,38 @@
xmlns="urn:xmlns:rhq-plugin"
xmlns:c="urn:xmlns:rhq-configuration">
+ <depends plugin="Script"/>
+
<server name="Puppet Client"
discovery="PuppetDiscovery"
class="PuppetComponent"
- createDeletePolicy="both">
+ supportsManualAdd="true"
+ description="The puppet client that will be invoked to process puppet recipes">
<plugin-configuration>
- <!-- TODO add your own here -->
- <c:simple-property name="dummy" />
+ <c:group name="executableEnvironment" displayName="Executable Runtime Environment">
+ <c:simple-property name="executable" required="true" description="The full path to the puppet client" />
+ <c:simple-property name="workingDirectory" required="false" description="When the executable is invoked, this will be its working directory." />
+ <c:list-property name="environmentVariables" required="false" description="Environment variables that are set when executing the executable">
+ <c:map-property name="environmentVariable">
+ <c:simple-property name="name" type="string" required="true" summary="true" description="Name of the environment variable"/>
+ <c:simple-property name="value" type="string" required="true" summary="true" description="Value of the environment variable" />
+ </c:map-property>
+ </c:list-property>
+ </c:group>
+ <c:group name="avail" displayName="Availability Definition">
+ <c:simple-property name="availabilityExecuteCheck" default="false" required="false" type="boolean" description="If specified and true, the ability to successfully execute the puppet client can determine whether or not it is considered up and available. If you set this to true, you normally do not set the availability regex settings in order to allow availability to be determined based solely on the successful execution, regardless of the exit code or output. If this is false, setting one of the avail regex settings will override it as if it were true."/>
+ <c:simple-property name="availabilityExitCodeRegex" required="false" description="If specified, the executable must return an exit code that matches this regular expression if the managed resource is to be considered up and available"/>
+ <c:simple-property name="availabilityOutputRegex" required="false" description="If specified, the executable must output text that matches this regular expression if the managed resource is to be considered up and available"/>
+ <c:simple-property name="availabilityArguments" required="false" description="If the executable needs to be executed in order to determine availability, these are the arguments that will be passed to the executable. If you do not specify the regex settings and you set the execute check setting to false, the executable will not be executed and these arguments will not be used - in this case, availability will be determined by the mere existence of the executable file."/>
+ </c:group>
+ <c:group name="version" displayName="Version Definition">
+ <c:simple-property name="versionArguments" default="--version" required="false" description="The arguments to pass to the executable that will help determine the version of the managed resource"/>
+ <c:simple-property name="versionRegex" default=".*" required="false" description="The regex that can pick out the version from the executable output. If the regex has a captured group, its matched content will be used as the version. If there is no captured group, the entire output will be used as the version."/>
+ <c:simple-property name="fixedVersion" required="false" description="If specified, this will be the version of the managed resource - the executable will not be invoked to determine it." />
+ </c:group>
</plugin-configuration>
- <!-- TODO process scans -->
-
<operation name="dummyOperation">
<!-- TODO supply parameters and return values -->
</operation>