Skip to content

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

  1. Retrieve Ivanti API credentials from Passwordstate
  2. Construct the API call to the AAP controller node
  3. Launch the job template by ID using the Ansible API
  4. 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 node
  • ivanti_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 launch
  • task_number: Extra variable to pass to the job template

Main Steps

  1. Get Ivanti Credentials from Passwordstate
  2. Retrieves API credentials for the specified user from Passwordstate

  3. Launch Job Template via API

  4. Constructs and sends a POST request to the AAP controller node's API endpoint
  5. Authenticates using Basic Auth with credentials from Passwordstate
  6. Passes extra variables (e.g., task_number) in the request body
  7. 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 template
  • task_number: Task number to pass as an extra variable
  • controller_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: true for 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