Skip to main content

CLI

RD-CLI

https://docs.rundeck.com/docs/learning/howto/learn-rd-cli.html 

Rundeck CLI (RD-CLI) is a Java client to access and interact with a Rundeck Instance from the command line. In a few words, Rundeck CLI is a Rundeck API abstraction tool. With Rundeck CLI is possible to view system information, list executions, list and manage jobs, manage keys, list and manage node source, projects, and jobs in the command line.

Installing

In OurCompose, the CLI can be installed by including the instructions given in the Rundeck documentation into the compositional_rundeck_additional_setup variable. At the moment, that is curling the install script down and running it to set up the repos, then using apt to install it.

Configuration

You need at least three environment variables to run the CLI tool against the server:

  1. RD_URL
  2. RD_USER
  3. RD_PASSWORD

You can either export these env vars into the shell itself, or set up an rd.conf filie. However, you would have to tell the CLI where that file was by pointing to it with the RD_CONF environment var.

Keep in mind that you can also use an API token instead of a user/password combination.

Available Commands

https://rundeck.github.io/rundeck-cli/commands/ 

   adhoc      - Dispatch adhoc COMMAND to matching nodes
   executions - List running executions, attach and follow their output, or kill them
   jobs       - List and manage Jobs
   keys       - Manage Keys via the Key Storage Facility.
   nodes      - List and manage node resources
   projects   - List and manage projects
   run        - Run a Job
   scheduler  - View scheduler information
   system     - View system information
   tokens     - Create, and manage tokens
   users      - Manage user information