You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support for the wait_for_completed flag to aap_job resource
Letting the user wait on aap_job resources to complete before continuing
creating aap resources. Extra parameters allow the user to tweak the
timeout and poll interval of this wait operation
Copy file name to clipboardExpand all lines: docs/resources/job.md
+9Lines changed: 9 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,8 @@ description: |-
4
4
Launches an AAP job.
5
5
A job is launched only when the resource is first created or when the resource is changed. The triggers argument can be used to launch a new job based on any arbitrary value.
6
6
This resource always creates a new job in AAP. A destroy will not delete a job created by this resource, it will only remove the resource from the state.
7
+
Moreover, you can set wait_for_completion to true, then Terraform will wait until this job is created and reaches any final state before continuing. This parameter works in both create and update operations.
8
+
You can also tweak wait_for_completion_poll_interval_seconds and wait_for_completion_timeout_seconds to control the timeout limit and poll interval.
7
9
---
8
10
9
11
# aap_job (Resource)
@@ -14,6 +16,10 @@ A job is launched only when the resource is first created or when the resource i
14
16
15
17
This resource always creates a new job in AAP. A destroy will not delete a job created by this resource, it will only remove the resource from the state.
16
18
19
+
Moreover, you can set `wait_for_completion` to true, then Terraform will wait until this job is created and reaches any final state before continuing. This parameter works in both create and update operations.
20
+
21
+
You can also tweak `wait_for_completion_poll_interval_seconds` and `wait_for_completion_timeout_seconds` to control the timeout limit and poll interval.
22
+
17
23
-> **Note** To pass an inventory to an aap_job resource, the underlying job template *must* have been conigured to prompt for the inventory on launch.
18
24
19
25
@@ -118,6 +124,9 @@ output "job_xyz" {
118
124
-`extra_vars` (String) Extra Variables. Must be provided as either a JSON or YAML string.
119
125
-`inventory_id` (Number) Identifier for the inventory where job should be created in. If not provided, the job will be created in the default inventory.
120
126
-`triggers` (Map of String) Map of arbitrary keys and values that, when changed, will trigger a creation of a new Job on AAP. Use 'terraform taint' if you want to force the creation of a new job without changing this value.
127
+
-`wait_for_completion` (Boolean) When this is set to `true`, Terraform will wait until this aap_job resource is created, reaches any final status and then, proceeds with the following resource operation
128
+
-`wait_for_completion_poll_interval_seconds` (Number) Sets the poll interval in seconds to wait between aap_job status updates. Default value of `5.0`
129
+
-`wait_for_completion_timeout_seconds` (Number) Sets the maximum amount of seconds Terraform will wait before timing out the updates, and the job creation will fail. Default value of `120`
0 commit comments