A Rundeck Notification Plugin that sends HTTP requests (e.g., POST, GET, PUT, DELETE) to a specified URL as a notification. This plugin supports multiple HTTP methods and configurable request bodies, allowing seamless integration with various HTTP-based services.
- Supports HTTP methods:
GET,POST,PUT,DELETE,PATCH,HEAD - Configurable content type and request body
- Detailed logging for debugging
- Handling of unsupported methods
-
Build the Plugin:
- Clone the repository and navigate to the plugin directory.
- Use Gradle to build the JAR file:
./gradlew build
- The JAR file will be generated in the
build/libsdirectory.
-
Install the Plugin:
- Copy the generated JAR file to Rundeck’s
libextdirectory (typically located at/var/lib/rundeck/libexton a Linux server). - Restart Rundeck to load the new plugin:
sudo service rundeckd restart
- Copy the generated JAR file to Rundeck’s
Once installed, the plugin can be configured in the Rundeck UI when creating or editing a job. The following properties are available:
- Remote URL: The URL where the HTTP request will be sent. This field is required.
- HTTP Method: The HTTP method to use for the request. Options include:
POST,GET,PUT,DELETE,PATCH,HEAD
- Content Type: The content type of the request body. Default is
application/jsonif a body is provided.- Options include
application/json,application/xml,text/plain,application/x-www-form-urlencoded,multipart/form-data.
- Options include
- Body Content: The content of the HTTP request body (e.g., JSON, XML, plain text). Required for methods that send data (like
POSTorPUT).
The plugin can be used as a notification in a Rundeck job. It sends HTTP requests based on the configured properties, allowing you to trigger HTTP-based workflows upon job completion, start, or failure.
- Create/Edit a Job in Rundeck.
- Add a Notification step.
- Select the HTTP Rundeck Notification Plugin and configure the properties as described above.
- Save and execute the job.
- Remote URL:
https://example.com/api/notify - Method:
POST - Content Type:
application/json - Body Content:
{"jobName": "TestJob", "status": "success"}
- Remote URL:
https://example.com/api/check - Method:
GET
- Remote URL:
https://example.com/api/update - Method:
PUT - Content Type:
application/xml - Body Content:
<update><id>123</id><status>completed</status></update>
Run unit tests with Gradle:
./gradlew test