github.com/atsaki/terraform@v0.4.3-0.20150919165407-25bba5967654/website/source/docs/providers/rundeck/r/job.html.md (about)

     1  ---
     2  layout: "rundeck"
     3  page_title: "Rundeck: rundeck_job"
     4  sidebar_current: "docs-rundeck-resource-job"
     5  description: |-
     6    The rundeck_job resource allows Rundeck jobs to be managed by Terraform.
     7  ---
     8  
     9  # rundeck\_job
    10  
    11  The job resource allows Rundeck jobs to be managed by Terraform. In Rundeck a job is a particular
    12  named set of steps that can be executed against one or more of the nodes configured for its
    13  associated project.
    14  
    15  Each job belongs to a project. A project can be created with the `rundeck_project` resource.
    16  
    17  ## Example Usage
    18  
    19  ```
    20  resource "rundeck_job" "bounceweb" {
    21      name = "Bounce Web Servers"
    22      project_name = "anvils"
    23      node_filter_query = "tags: web"
    24      description = "Restart the service daemons on all the web servers"
    25  
    26      command {
    27          shell_command = "sudo service anvils restart"
    28      }
    29  }
    30  ```
    31  
    32  ## Argument Reference
    33  
    34  The following arguments are supported:
    35  
    36  * `name` - (Required) The name of the job, used to describe the job in the Rundeck UI.
    37  
    38  * `description` - (Required) A longer description of the job, describing the job in the Rundeck UI.
    39  
    40  * `project_name` - (Required) The name of the project that this job should belong to.
    41  
    42  * `group_name` - (Optional) The name of a group within the project in which to place the job.
    43    Setting this creates collapsable subcategories within the Rundeck UI's project job index.
    44  
    45  * `log_level` - (Optional) The log level that Rundeck should use for this job. Defaults to "INFO".
    46  
    47  * `allow_concurrent_executions` - (Optional) Boolean defining whether two or more executions of
    48    this job can run concurrently. The default is `false`, meaning that jobs will only run
    49    sequentially.
    50  
    51  * `max_thread_count` - (Optional) The maximum number of threads to use to execute this job, which
    52    controls on how many nodes the commands can be run simulateneously. Defaults to 1, meaning that
    53    the nodes will be visited sequentially.
    54  
    55  * `continue_on_error` - (Optional) Boolean defining whether Rundeck will continue to run
    56    subsequent steps if any intermediate step fails. Defaults to `false`, meaning that execution
    57    will stop and the execution will be considered to have failed.
    58  
    59  * `rank_attribute` - (Optional) The name of the attribute that will be used to decide in which
    60    order the nodes will be visited while executing the job across multiple nodes.
    61  
    62  * `rank_order` - (Optional) Keyword deciding which direction the nodes are sorted in terms of
    63    the chosen `rank_attribute`. May be either "ascending" (the default) or "descending".
    64  
    65  * `preserve_options_order`: (Optional) Boolean controlling whether the configured options will
    66    be presented in their configuration order when shown in the Rundeck UI. The default is `false`,
    67    which means that the options will be displayed in alphabetical order by name.
    68  
    69  * `command_ordering_strategy`: (Optional) The name of the strategy used to describe how to
    70    traverse the matrix of nodes and commands. The default is "node-first", meaning that all commands
    71    will be executed on a single node before moving on to the next. May also be set to "step-first",
    72    meaning that a single step will be executed across all nodes before moving on to the next step.
    73  
    74  * `node_filter_query` - (Optional) A query string using
    75    [Rundeck's node filter language](http://rundeck.org/docs/manual/node-filters.html#node-filter-syntax)
    76    that defines which subset of the project's nodes will be used to execute this job.
    77  
    78  * `node_filter_exclude_precedence`: (Optional) Boolean controlling a deprecated Rundeck feature that controls
    79    whether node exclusions take priority over inclusions.
    80  
    81  * `option`: (Optional) Nested block defining an option a user may set when executing this job. A
    82    job may have any number of options. The structure of this nested block is described below.
    83  
    84  * `command`: (Required) Nested block defining one step in the job workflow. A job must have one or
    85    more commands. The structure of this nested block is described below.
    86  
    87  `option` blocks have the following structure:
    88  
    89  * `name`: (Required) Unique name that will be shown in the UI when entering values and used as
    90    a variable name for template substitutions.
    91  
    92  * `default_value`: (Optional) A default value for the option.
    93  
    94  * `value_choices`: (Optional) A list of strings giving a set of predefined values that the user
    95    may choose from when entering a value for the option.
    96  
    97  * `value_choices_url`: (Optional) Can be used instead of `value_choices` to cause Rundeck to
    98    obtain a list of choices dynamically by fetching this URL.
    99  
   100  * `require_predefined_choice`: (Optional) Boolean controlling whether the user is allowed to
   101    enter values not included in the predefined set of choices (`false`, the default) or whether
   102    a predefined choice is required (`true`).
   103  
   104  * `validation_regex`: (Optional) A regular expression that a provided value must match in order
   105    to be accepted.
   106  
   107  * `description`: (Optional) A longer description of the option to be shown in the UI.
   108  
   109  * `required`: (Optional) Boolean defining whether the user must provide a value for the option.
   110    Defaults to `false`.
   111  
   112  * `allow_multiple_values`: (Optional) Boolean defining whether the user may select multiple values
   113    from the set of predefined values. Defaults to `false`, meaning that the user may choose only
   114    one value.
   115  
   116  * `multi_value_delimiter`: (Optional) Delimiter used to join together multiple values into a single
   117    string when `allow_multiple_values` is set and the user chooses multiple values.
   118  
   119  * `obscure_input`: (Optional) Boolean controlling whether the value of this option should be obscured
   120    during entry and in execution logs. Defaults to `false`, but should be set to `true` when the
   121    requested value is a password, private key or any other secret value.
   122  
   123  * `exposed_to_scripts`: (Optional) Boolean controlling whether the value of this option is available
   124    to scripts executed by job commands. Defaults to `false`.
   125  
   126  `command` blocks must have any one of the following combinations of arguments as contents:
   127  
   128  * `shell_command` gives a single shell command to execute on the nodes.
   129  
   130  * `inline_script` gives a whole shell script, inline in the configuration, to execute on the nodes.
   131  
   132  * `script_file` and `script_file_args` together describe a script that is already pre-installed
   133    on the nodes which is to be executed.
   134  
   135  * A `job` block, described below, causes another job within the same project to be executed as
   136    a command.
   137  
   138  * A `step_plugin` block, described below, causes a step plugin to be executed as a command.
   139  
   140  * A `node_step_plugin` block, described below, causes a node step plugin to be executed once for
   141    each node.
   142  
   143  A command's `job` block has the following structure:
   144  
   145  * `name`: (Required) The name of the job to execute. The target job must be in the same project
   146    as the current job.
   147  
   148  * `group_name`: (Optional) The name of the group that the target job belongs to, if any.
   149  
   150  * `run_for_each_node`: (Optional) Boolean controlling whether the job is run only once (`false`,
   151    the default) or whether it is run once for each node (`true`).
   152  
   153  * `args`: (Optional) A string giving the arguments to pass to the target job, using
   154    [Rundeck's job arguments syntax](http://rundeck.org/docs/manual/jobs.html#job-reference-step).
   155  
   156  A command's `step_plugin` or `node_step_plugin` block both have the following structure:
   157  
   158  * `type`: (Required) The name of the plugin to execute.
   159  
   160  * `config`: (Optional) Map of arbitrary configuration parameters for the selected plugin.
   161  
   162  ## Attributes Reference
   163  
   164  The following attribute is exported:
   165  
   166  * `id` - A unique identifier for the job.