Interview Prep/Ansible/AWX, AAP and Cloud Integration

How do custom credential types work in AWX?

AdvancedProductionAWX, AAP and Cloud Integration
Answer

A custom credential type defines inputs (the fields a user fills in, with secret ones encrypted) and injectors (how those values reach the job: env vars, extra vars or temporary files). Playbooks never see where the secret is stored.

# Input configuration
fields:
  - id: api_token
    type: string
    label: Monitoring API token
    secret: true
  - id: api_url
    type: string
    label: Monitoring API URL
required: [api_token, api_url]

# Injector configuration
env:
  MONITORING_TOKEN: "{{ api_token }}"
  MONITORING_URL: "{{ api_url }}"

The playbook reads lookup('ansible.builtin.env', 'MONITORING_TOKEN'). For tools that need a config file, use a file injector and point an env var at {{ tower.filename }}. This keeps secrets out of extra vars, which are visible in job details.

All Ansible questions Roadmap: Ansible

More on AWX, AAP and Cloud Integration