At work, I’ve been using Rundeck for a few projects; or rather one of my colleagues introduced Rundeck to us and as new kid on the team, I was suggested to work with it. My assignment was fairly simple; though without prior knowledge on Rundeck, it was a learning curve.

The assignment

Allow a user to select which service(s) to restart/start/stop on various selectable environments. Ensure puppet is also stopped if the selected action is stop.

The solution

Bear in mind that this was my *first* assignment related to Rundeck.

Requirements

This entire thing hinges on tags; if you don’t have nodes with tags, stop here and go tag your nodes properly.

  • ‘Details’-tab:
    • Enter a Job Name ‘Start/Stop/Restart services on non-production servers’
    • In the textbox next to the Job Name, you can enter an extra folder; I added ‘Non-Production’.
  • ‘Workflow’-tab:
    • Header ‘Options’ - Click add an Option - Option Type : Text - Option Name : environment - Option Label: Server Environment - Description : Select which environment you wish to work with; the correct servers will be selected based on this. - Default Value : Leave empty unless you want a default. - Input Type : Plain Text - Allowed Values : Check ‘List’ and enter the environments EXACTLY as they are added as tags to nodes in Rundeck. - Sort Values : Whatever floats your boat here; but note the delimiter as this can make or break your entire setup. - Restrictions : Depending on what you want, I would definately go with ‘Enforcred from Allowed Values’ here. - Required: Yes - Should be hidden: In this case; No. - Multi-Valued : For the environments, No, for the services, Yes. - Click ‘Save’.
      • Add another Option, this time: - Option Name : services
      • Option Label : Selected Services
      • Option Description : Select which services you which to action.
      • Multi-Valued : Yes.