What is the nature and description of the request?
Requesting the ability to execute a job on resource destruction. Quote from the customer:
... we need the AAP provider to support selective job execution during the destroy phase, similar to how the local-exec provisioner with when = destroy works in our current workaround. This would allow us to cleanly handle decommissioning tasks using the native AAP provider, avoiding reliance on null_resource and curl.
Why does the customer need this? (List the business requirements here)
To allow for seamless decommissioning of resources using Terraform and having a built-in solution to it instead of a null_resource and curl.
How would you like to achieve this? (List the functional requirements here)
1. Support for a when = destroy attribute or equivalent in the aap_job resource to trigger jobs only during destruction.
2. Ability to pass extra_vars and other job parameters (e.g., inventory_id, limit) to the destroy-time job, mirroring the create-time functionality.
3. Option to configure wait_for_completion for destroy-time jobs to ensure proper execution before resource termination.