Ivanti Launch Job Template by ID → Ivanti Automation
Overview
This automation playbook launches an Ansible Automation Platform (AAP) job template by its ID, triggered from Ivanti or other systems. It securely retrieves credentials from Passwordstate, constructs the API call, and launches the specified job template with any required extra variables.
High-Level Flow
- Retrieve Ivanti API credentials from Passwordstate
- Construct the API call to the AAP controller node
- Launch the job template by ID using the Ansible API
- Pass extra variables (such as task number) to the job template
Execution Flow
sequenceDiagram
participant Ivanti as Ivanti/External Trigger
participant AAP as Ansible Automation
participant PWS as Passwordstate
participant Controller as AAP Controller Node
Ivanti->>AAP: Trigger job template launch playbook
AAP->>PWS: Get Ivanti API credentials
PWS-->>AAP: API credentials
AAP->>Controller: Launch job template by ID (API call)
Controller-->>AAP: Job launch response
Components
Ivanti/External Trigger
- Trigger: Initiates the playbook to launch a job template by ID
Passwordstate
- Credential Storage: Securely stores Ivanti API credentials, retrieved at runtime
Ansible Automation Platform (AAP) Controller
- Job Template Launch: Receives API call to launch the specified job template with extra variables
Playbook Logic
Variables
controller_node: Hostname of the AAP controller nodeivanti_ansible_user: Username for API authentication (Passwordstate lookup)ansible_job_type: Type of job (e.g., job_templates)ansible_id: ID of the job template to launchtask_number: Extra variable to pass to the job template
Main Steps
- Get Ivanti Credentials from Passwordstate
-
Retrieves API credentials for the specified user from Passwordstate
-
Launch Job Template via API
- Constructs and sends a POST request to the AAP controller node's API endpoint
- Authenticates using Basic Auth with credentials from Passwordstate
- Passes extra variables (e.g., task_number) in the request body
- Accepts status codes 200, 201, or 202 as success
Task Input & Output
Input Parameters
ansible_job_type: Type of job (e.g., job_templates)ansible_id: ID of the job templatetask_number: Task number to pass as an extra variablecontroller_node,ivanti_ansible_user: API connection details
Output Actions
- On Success: Job template is launched on the AAP controller node
- On Failure: Errors are handled by Ansible and can be captured in logs or downstream steps
Error Handling & Idempotency
- All credentials are handled with
no_log: truefor security - Playbook is safe for repeated runs; each run launches a new job template instance
Benefits
- Automates launching of AAP job templates from Ivanti or other systems
- Integrates securely with Passwordstate for credential management
- Supports passing extra variables for flexible automation
- Reduces manual overhead for job launches and integrations
Notes
- The playbook is designed to be idempotent and safe for repeated runs
- All sensitive operations are delegated to localhost for security
- API calls use Basic Auth with credentials from Passwordstate
- Extra variables can be extended as needed for more complex job templates