You can configure a Git repository for each project and store Rundeck jobs in the repository. The following extract is an example of a Rundeck job that you can define in the Git repository for importing:
- description: Shows uptime of the system.
executionEnabled: true
group: systools
loglevel: INFO
name: uptime
nodeFilterEditable: false
nodefilters:
dispatch:
excludePrecedence: true
keepgoing: true
rankOrder: ascending
threadcount: 1
filter: tags:cicd
nodesSelectedByDefault: true
options:
- enforced: true
name: pretty
values:
- -p
scheduleEnabled: true
sequence:
commands:
- exec: uptime ${option.pretty}
keepgoing: false
pluginConfig:
WorkflowStrategy:
node-first: null
strategy: node-first
This approach has the following limitations:
name
parameter in job definition files is required.
The value of the name
parameter may differ from the file name and
determines the resulting name of a job.To configure job importing for a project:
To use a remote repository as a source of jobs, extend the project’s
metadata as required. A minimal configuration includes the address
parameter for the import
plugin:
parameters:
rundeck:
client:
project:
test_project:
plugin:
import:
address: https://github.com/path/to/repo.git
A complete list of all available parameters for the import
plugin
includes:
Parameter and default value | Values | Description |
---|---|---|
address: https://github.com/path/to/repo.git |
String | A valid Git URL (Required) |
branch: master |
String | The name of a repository branch (Optional) |
import_uuid_behavior: remove |
String preserve , remove , or archive |
The UUID importing mode in job descriptions (Optional) |
format: yaml |
String yaml or xml |
The extension of files containing job definitions (Optional) |
path_template: ${job.group}${job.name}.${config.format} |
String | The pattern to recognize job definition files (Optional) |
file_pattern: '.*\.yaml' |
Regex | The regex that filters jobs for importing (Optional) |
Example of the import
plugin configuration with all the available
parameters:
parameters:
rundeck:
client:
project:
test_project:
plugin:
import:
address: https://github.com/akscram/rundeck-jobs.git
branch: master
import_uuid_behavior: remove
format: yaml
path_template: ${job.group}${job.name}.${config.format}
file_pattern: '.*\.yaml'
Apply the Rundeck client state:
salt-call state.sls rundeck.client