Skip to main content

A Charlesbot plugin that integrates with Rundeck

Project description

Travis CI Code Coverage Software License

A Charlesbot plugin that integrates with Rundeck!

How does this work

This plugin adds the following !help targets:

!lock status - Prints the status of the Rundeck deployment lock
!lock acquire - Acquires the Rundeck deployment lock (only available to Slack admins)
!lock release - Releases the Rundeck deployment lock (only available to Slack admins)

The !lock commands are designed to give folks the ability to quickly and efficiently disable (or enable) individual Rundeck jobs. This is very useful when troubleshooting a production issue where you don’t want additional deployments going out and adding fuel to the fire.

https://raw.githubusercontent.com/marvinpinto/charlesbot-rundeck/master/images/rundeck-lock.png

Installation

pip install charlesbot-rundeck

Instructions for how to run Charlesbot are over at https://www.charlesbot.org/docs/installation.html.

Configuration

In your Charlesbot config.yaml, enable this plugin by adding the following entry to the main section:

main:
  enabled_plugins:
    - 'charlesbot_rundeck.rundeck.Rundeck'

Rundeck ACL Policy

Make sure you have a apitoken.aclpolicy file that looks something like:

description: API project level access control
context:
  project: '.*' # all projects
for:
  # ...
  job:
    - allow: '*'
  # ...
by:
  group: api_token_group

You essentially need to give the api_token_group the ability to enable and disable executions for all jobs in all projects (more details)

Notes

Rundeck 2.6.2 introduces the ability to enable or disable passive mode programatically using the system/executions endpoint. This endpoint unfortunately did not work for this use-case because it disables all Rundeck job executions. This plugin is more geared towards folks who would rather disable individual job executions.

Development

At a very minimum, you’ll need Python 3.4.3, a functional Docker environment, and a Slack bot token to get going. I highly recommend you read the Charlesbot docs to get an idea of how this all fits together.

Create a local development.yaml file that looks something like the following.

main:
  slackbot_token: 'xoxb-...'
  enabled_plugins:
    - 'charlesbot_rundeck.rundeck.Rundeck'

rundeck:
  token: 'baiY8aw4Ieng0aQuoo'
  url: 'http://my.rundeck.test:4440'
  deployment_status_channel: 'charlesbot-rundeck-test-channel'
  lock_jobs:
    - project: 'test-project'
      name: 'deploy-website'
      friendly_name: 'deploy website'
    - project: 'test-project'
      name: 'deploy-app'
      friendly_name: 'deploy app'

Add the following entry to your /etc/hosts file.

172.17.0.1 my.rundeck.test

Start up a local Rundeck Docker instance.

make rundeck-server

After your Rundeck instance is up and running, seed it with some sample project/job data.

make rundeck-server-bootstrap

After you have all of this in place, you should be ready to spin up your local Charlesbot instance!

make run

License

See the LICENSE.txt file for license rights and limitations (MIT).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

charlesbot-rundeck-0.2.1.tar.gz (6.4 kB view details)

Uploaded Source

File details

Details for the file charlesbot-rundeck-0.2.1.tar.gz.

File metadata

File hashes

Hashes for charlesbot-rundeck-0.2.1.tar.gz
Algorithm Hash digest
SHA256 eb8186cb64dd28633f438311b1722358e6bb83488c77208346929c5a43ce5434
MD5 662d1d9e93b7c88e04098fb24f2800fc
BLAKE2b-256 53fccd64f9b719cc68563122938f59ea6b82e359cb1ef74f219b0eb0a5151df3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page