Skip to content

Commit

Permalink
Merge pull request #52 from criteo-forks/master
Browse files Browse the repository at this point in the history
Provide FileCopier plugin
  • Loading branch information
gschueler authored Dec 18, 2017
2 parents 5217310 + 87949a1 commit 3d2ce2d
Show file tree
Hide file tree
Showing 6 changed files with 941 additions and 687 deletions.
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
Rundeck WinRM Plugin
--------------------

This is a [Rundeck Node Execution plugin][1] that uses WinRM to connect to Windows and execute commands. It uses the [OverThere Library][2] to provide the WinRM implementation, and uses Basic authentication over HTTPS.
These are a [Rundeck Node Executor plugin][1] and a [Rundeck File Copier plugin][2] that uses WinRM to connect to Windows and execute commands. It uses the [OverThere Library][3] to provide the WinRM implementation, and uses Basic authentication over HTTPS.

[1]: http://rundeck.org/docs/manual/plugins.html#node-execution-plugins
[2]: https://github.com/xebialabs/overthere/
[1]: http://rundeck.org/docs/developer/node-executor-plugin.html
[2]: http://rundeck.org/docs/developer/file-copier-plugin.html
[3]: https://github.com/xebialabs/overthere/

Compatible with Rundeck 2.3.x+

Expand All @@ -28,18 +29,22 @@ If using Kerberos for authentication, also follow these guides:
Configure The Plugin
====

This plugin provides a NodeExecutor called `overthere-winrm`, which you can set as on your node defintion:
This plugin provides a NodeExecutor and a FileCopier called `overthere-winrm`, which you can set as on your node definition:

<node name="winNode" node-executor="overthere-winrm" .../>

Or set as the default NodeExecutor for your project/framework properties file, with `service.NodeExecutor.default.provider=overthere-winrm`.
and/or

<node name="winNode" file-copier="overthere-winrm" .../>

Or set as the default NodeExecutor for your project/framework properties file, with `service.NodeExecutor.default.provider=overthere-winrm` and `service.FileCopier.default.provider=overthere-winrm`.

These Node attributes are used to connect to the remote host:

* `username` - Remote username. If using Kerberos, see [Using Kerberos Authentication](#using-kerberos-authentication)
* `hostname` - Remote host. Can include "host:port" to specify port number other than the default 5985/5986 (http/https).

Password authentcation can be performed in one of two ways:
Password authentication can be performed in one of two ways:

1. Create a Rundeck Job with a [Secure Authentication Option][1], to pass in the password to use. The default name
of this option should be "winrmPassword", but you can change the name that is expected, if necessary.
Expand All @@ -61,6 +66,9 @@ These additional configuration attributes can be set on the Node, or in the proj
* default-value: "winrmPassword", so simply define a Secure Authentication Option on your Job with the name "winrmPassword".
* `winrm-password-storage-path` - Specifies a [Key Storage Path][] to look up the authentication password from. It can contain property references like `${node.name}` to evaluate at runtime. If specified, it will be used instead of the `winrm-password-option`.

For file copier plugin:
* `file-copy-destination-dir` - Folder location where the remote script to be executed will be copied

[Key Storage Path]: http://rundeck.org/docs/administration/key-storage.html


Expand Down
89 changes: 48 additions & 41 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext.pluginClassNames='com.dtolabs.rundeck.plugin.overthere.OTWinRMNodeExecutor'
ext.pluginClassNames='com.dtolabs.rundeck.plugin.overthere.OTWinRMNodeExecutor,com.dtolabs.rundeck.plugin.overthere.OTWinRMFileCopier'

defaultTasks 'clean','build'
version = '1.3.3-SNAPSHOT'
version = '1.3.4-SNAPSHOT'
ext.rundeckPluginVersion= '1.1'
apply plugin: 'java'
apply plugin: 'idea'
Expand Down Expand Up @@ -30,7 +30,7 @@ repositories {
mavenCentral()
}
dependencies {
pluginLibs(group: 'com.xebialabs.overthere', name: 'overthere', version: '4.3.0'){
pluginLibs(group: 'com.xebialabs.overthere', name: 'overthere', version: '5.0.2'){
exclude( module: 'bcprov-jdk15on')
exclude( module: 'jzlib')
exclude( module: 'sshj')
Expand Down Expand Up @@ -114,51 +114,58 @@ task createPom << {
}
}

build{
plugins{
plugin{
artifactId 'maven-compiler-plugin'
version '2.3.2'
configuration{
source '1.6'
target '1.6'
properties {
'plugin.release.version'('2.5.1')
}

scm{
connection 'scm:git:[email protected]:rundeck-plugins/rundeck-winrm-plugin.git'
developerConnection 'scm:git:[email protected]:rundeck-plugins/rundeck-winrm-plugin.git'
url '[email protected]:rundeck-plugins/rundeck-winrm-plugin.git'
tag 'HEAD'
}
}
}.withXml {
asNode().appendNode('build').with {
appendNode('plugins').with {
appendNode('plugin').with {
appendNode('artifactId', 'maven-compiler-plugin')
appendNode('version', '2.3.2')
appendNode('configuration').with {
appendNode('source', '1.6')
appendNode('target', '1.6')
}
}
appendNode('plugin').with {
appendNode('artifactId', 'maven-assembly-plugin')
appendNode('version', '2.2.2')
appendNode('executions').appendNode('execution').with {
appendNode('id', 'make-assembly')
appendNode('phase', 'package')
appendNode('goals').with {
appendNode('goal', 'single')
}
}
plugin() {
artifactId('maven-assembly-plugin')
version('2.2.2')
executions() {
execution() {
id('make-assembly')
phase('package')
goals() {
goal('single')
}
}
appendNode('configuration').with {
appendNode('appendAssemblyId', 'false')
appendNode('descriptors').with {
appendNode('descriptor', 'src/main/assembly/jar.xml')
}
configuration() {
appendAssemblyId('false')
descriptors() {
descriptor('src/main/assembly/jar.xml')
}
archive() {
manifestEntries() {
'Rundeck-Plugin-Version'(rundeckPluginVersion)
'Rundeck-Plugin-File-Version'(version)
'Rundeck-Plugin-Archive'('true')
'Rundeck-Plugin-Classnames'(pluginClassNames)
'Rundeck-Plugin-Libs'(libList)
}
appendNode('archive').with {
appendNode('manifestEntries').with {
appendNode('Rundeck-Plugin-Version', this.rundeckPluginVersion)
appendNode('Rundeck-Plugin-File-Version', this.version)
appendNode('Rundeck-Plugin-Archive', 'true')
appendNode('Rundeck-Plugin-Classnames', this.pluginClassNames)
appendNode('Rundeck-Plugin-Libs', libList)
}
}
}
}
}
scm{
connection 'scm:git:[email protected]:rundeck-plugins/rundeck-winrm-plugin.git'
developerConnection 'scm:git:[email protected]:rundeck-plugins/rundeck-winrm-plugin.git'
url '[email protected]:rundeck-plugins/rundeck-winrm-plugin.git'
tag 'HEAD'
appendNode('plugin').with {
appendNode('artifactId', 'maven-release-plugin')
appendNode('version', '${plugin.release.version}')
}
}
}
}.writeTo("pom.xml")
Expand Down
57 changes: 28 additions & 29 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>rundeck-plugins-parent</artifactId>
<groupId>org.rundeck-plugins</groupId>
<artifactId>rundeck-plugins-parent</artifactId>
<version>2</version>
</parent>
<groupId>org.rundeck-plugins</groupId>
Expand All @@ -19,15 +19,34 @@
<distribution>repo</distribution>
</license>
</licenses>
<properties>
<plugin.release.version>2.5.1</plugin.release.version>
</properties>
<scm>
<connection>scm:git:[email protected]:rundeck-plugins/rundeck-winrm-plugin.git</connection>
<developerConnection>scm:git:[email protected]:rundeck-plugins/rundeck-winrm-plugin.git</developerConnection>
<url>[email protected]:rundeck-plugins/rundeck-winrm-plugin.git</url>
<tag>HEAD</tag>
</scm>
<properties>
<plugin.release.version>2.5.1</plugin.release.version>
</properties>
<dependencies>
<dependency>
<groupId>org.rundeck</groupId>
<artifactId>rundeck-core</artifactId>
<version>2.3.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.xebialabs.overthere</groupId>
<artifactId>overthere</artifactId>
<version>5.0.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-nop</artifactId>
<version>1.6.3</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
Expand Down Expand Up @@ -58,10 +77,10 @@
<archive>
<manifestEntries>
<Rundeck-Plugin-Version>1.1</Rundeck-Plugin-Version>
<Rundeck-Plugin-File-Version>1.3.2-SNAPSHOT</Rundeck-Plugin-File-Version>
<Rundeck-Plugin-File-Version>1.3.4-SNAPSHOT</Rundeck-Plugin-File-Version>
<Rundeck-Plugin-Archive>true</Rundeck-Plugin-Archive>
<Rundeck-Plugin-Classnames>com.dtolabs.rundeck.plugin.overthere.OTWinRMNodeExecutor</Rundeck-Plugin-Classnames>
<Rundeck-Plugin-Libs>lib/overthere-4.3.0.jar lib/slf4j-nop-1.6.3.jar lib/jcifs-1.3.17.jar lib/httpcore-4.4.1.jar lib/commons-codec-1.10.jar lib/slf4j-api-1.7.12.jar lib/truezip-file-7.7.8.jar lib/javassist-3.17.1-GA.jar lib/commons-compress-1.9.jar lib/truezip-driver-zip-7.7.8.jar lib/annotations-3.0.0.jar lib/truezip-kernel-7.7.8.jar lib/scannit-1.4.0.jar lib/truezip-driver-file-7.7.8.jar lib/httpclient-4.4.1.jar</Rundeck-Plugin-Libs>
<Rundeck-Plugin-Classnames>com.dtolabs.rundeck.plugin.overthere.OTWinRMNodeExecutor,com.dtolabs.rundeck.plugin.overthere.OTWinRMFileCopier</Rundeck-Plugin-Classnames>
<Rundeck-Plugin-Libs>lib/overthere-5.0.2.jar lib/slf4j-nop-1.6.3.jar lib/scannit-1.4.1.jar lib/jcifs-1.3.17.jar lib/smbj-0.3.0.jar lib/mbassador-1.3.0.jar lib/bcpkix-jdk15on-1.57.jar lib/httpclient-4.4.1.jar lib/httpcore-4.4.1.jar lib/commons-codec-1.10.jar lib/truezip-file-7.7.8.jar lib/javassist-3.17.1-GA.jar lib/truezip-driver-zip-7.7.8.jar lib/truezip-kernel-7.7.8.jar lib/truezip-swing-7.7.8.jar lib/commons-compress-1.9.jar lib/annotations-3.0.0.jar lib/truezip-driver-file-7.7.8.jar lib/slf4j-api-1.7.25.jar</Rundeck-Plugin-Libs>
</manifestEntries>
</archive>
</configuration>
Expand All @@ -72,24 +91,4 @@
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.rundeck</groupId>
<artifactId>rundeck-core</artifactId>
<version>2.3.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-nop</artifactId>
<version>1.6.3</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.xebialabs.overthere</groupId>
<artifactId>overthere</artifactId>
<version>4.3.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
Loading

0 comments on commit 3d2ce2d

Please sign in to comment.