Resource Model Sources

Rundeck includes these Built-in plugins in the core installation:

file

Uses a file on the file system, in any of the supported Resources formats.

url

GETs a URL, and expects one of the supported Resources formats.

directory

looks at all files in a directory for suppored file extensions, and internally uses the file provider for each file that matches.

script

Executes a script and parses the output as one of the supported formats

To configure these providers use the following configuration properties.

File Resource Model Source Configuration

The file Resource Model Source provider reads a file in one of the supported Resource Model Document Formats.

Configuration properties for file Resource Model Source provider
NameValueNotes
filefile pathPath to a file on disk.
formatformat nameCan be used to declare the format explicitly. Otherwise the format is determined from the file's extension.
requireFileExiststrue/falseIf true and the file is missing, causes a failure to load the nodes. (Default: false)
includeServerNodetrue/falseIf true, include the Project's server node automatically. (Default: false)
generateFileAutomaticallytrue/falseIf true, create the file automatically if it is missing. (Default: false)

The value of format must be one of the supported Resource Model Document Formats. The built-in formats are: resourcexml or resourceyaml, but any format provided by a Resource Format Plugin can be specified as well.

Example:

resources.source.1.type=file
resources.source.1.file=/home/rundeck/projects/example/etc/resources2.xml
resources.source.1.format=resourcexml
resources.source.1.requireFileExists=true
resources.source.1.includeServerNode=true
resources.source.1.generateFileAutomatically=true

URL Resource Model Source Configuration

The url Resource Model Source provider performs a HTTP GET request to retrieve the Nodes definition.

Configuration properties:

Configuration properties for url Resource Model Source provider
NameValueNotes
urlURLA valid URL, either http:, https: or file: protocol.
cachetrue/falseIf true, use ETag/Last-Modified information from the server to only download new content if it has changed. If false, always download the content. (Default: true)
timeoutsecondsNumber of seconds before request fails due to timeout. 0 means no timeout. (Default: 30)

The Resource Model Document Format that is used is determined by the MIME type sent by the remote server. The built-in formats accept "*/xml" and "*/yaml" and "*/x-yaml".

Example:

resources.source.1.type=url
resources.source.1.url=file:/home/rundeck/projects/example/etc/resources2.xml
resources.source.1.cache=true
resources.source.1.timeout=0

Directory Resource Model Source Configuration

The directory Resource Model Source provider lists all files in a directory, and loads each one that has a supported file extension as File Resource Model Source with all default configuration options.

Configuration properties for directory Resource Model Source provider
NameValueNotes
directorydirectory pathAll files in the directory that have a supported file extension will be loaded

Example:

resources.source.2.type=directory
resources.source.2.directory=/home/rundeck/projects/example/resources

Script Resource Model Source Configuration

The script Resource Model Source provider executes a script file and reads the output of the script as one of the supported [Resource Model Document Formats].

Configuration properties for script Resource Model Source provider
NameValueNotes
fileScript file pathIf required by the interpreter, the file should be executable
interpreterCommand or interpreter to usee.g. "bash -c"
argsAdditional arguments to passThe arguments will be added after the script file name to the executed commandline
formatFormat nameMust be used to declare the format explicitly.

The script will be executed in this way:

[interpreter] file [args]

All output on STDOUT will be passed to a Resource Format Parser to parse. The format specified must be available.

Example:

resources.source.2.type=script
resources.source.2.file=/home/rundeck/projects/example/etc/generate.sh
resources.source.2.interpreter=bash -c
resources.source.2.args=-project example
resources.source.2.format=resourceyaml

Resource Model Document Formats

Resource Model Document Formats are defined by plugins that provide Generators and Parsers, typically in matched pairs, with both a parser and generator for the same format name.

Resource Format Plugins

Rundeck includes two built-in plugins in the core installation:

resourcexml

Supports the Resource XML document format: resource-XML.

Supported MIME types:

  • Generator: "text/xml"
  • Parser: "*/xml"

Supported File extensions:

  • ".xml"
resourceyaml

Supports the Resource YAML document format: resource-YAML.

Supported MIME types:

  • Generator: "text/yaml", "text/x-yaml", "application/yaml", "application/x-yaml"
  • Parser: "*/yaml", "*/x-yaml"

Supported File extensions:

  • ".yml", ".yaml"