From fdda04c544910ca264cbf6446100f24a6ff0505a Mon Sep 17 00:00:00 2001 From: Samuel Berthe Date: Wed, 26 Feb 2020 12:18:24 +0100 Subject: [PATCH 1/2] feat(job resource): adding support for timeout --- rundeck/resource_job.go | 6 ++++++ rundeck/resource_job_test.go | 1 + 2 files changed, 7 insertions(+) diff --git a/rundeck/resource_job.go b/rundeck/resource_job.go index 7a460cc50a..49d924f4e0 100644 --- a/rundeck/resource_job.go +++ b/rundeck/resource_job.go @@ -106,6 +106,11 @@ func resourceRundeckJob() *schema.Resource { Optional: true, }, + "timeout": { + Type: schema.TypeString, + Optional: true, + }, + "schedule": { Type: schema.TypeString, Optional: true, @@ -433,6 +438,7 @@ func jobFromResourceData(d *schema.ResourceData) (*JobDetail, error) { ProjectName: d.Get("project_name").(string), Description: d.Get("description").(string), ExecutionEnabled: d.Get("execution_enabled").(bool), + Timeout: d.Get("timeout").(string), ScheduleEnabled: d.Get("schedule_enabled").(bool), LogLevel: d.Get("log_level").(string), AllowConcurrentExecutions: d.Get("allow_concurrent_executions").(bool), diff --git a/rundeck/resource_job_test.go b/rundeck/resource_job_test.go index f23850079d..fb37a3b089 100644 --- a/rundeck/resource_job_test.go +++ b/rundeck/resource_job_test.go @@ -191,6 +191,7 @@ resource "rundeck_job" "test" { success_on_empty_node_filter = true max_thread_count = 1 rank_order = "ascending" + timeout = "42m" schedule = "0 0 12 * * * *" schedule_enabled = true option { From 6bae5a765bf1e02183424fa56cbaf01e74491eea Mon Sep 17 00:00:00 2001 From: Samuel Berthe Date: Wed, 26 Feb 2020 12:44:43 +0100 Subject: [PATCH 2/2] doc(job resource): adding support for timeout --- website/docs/r/job.html.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/website/docs/r/job.html.md b/website/docs/r/job.html.md index 7cc9bcdf39..811137d148 100644 --- a/website/docs/r/job.html.md +++ b/website/docs/r/job.html.md @@ -52,6 +52,8 @@ The following arguments are supported: * `log_level` - (Optional) The log level that Rundeck should use for this job. Defaults to "INFO". +* `timeout` - (Optional) The maximum time for an execution to run. Time in seconds, or specify time units: "120m", "2h", "3d". Use blank or 0 to indicate no timeout. + * `schedule` - (Optional) The jobs schedule in Unix crontab format * `schedule_enabled` - (Optional) Sets the job schedule to be enabled or disabled. Defaults to `true`. @@ -171,7 +173,7 @@ A command's `job` block has the following structure: * `args`: (Optional) A string giving the arguments to pass to the target job, using [Rundeck's job arguments syntax](http://rundeck.org/docs/manual/jobs.html#job-reference-step). - + * `nodefilters`: (Optional) A map for overriding the referenced job's node filters. A command's `nodefilters` block has the following structure: