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.
More on AWX, AAP and Cloud Integration
AWX or Red Hat Ansible Automation Platform: what is the difference and what do you pay for?BeginnerWhat are the core objects in AWX and how do they fit together?BeginnerHow do you manage AWX configuration as code?IntermediateHow do you connect AWX to an external secrets manager?IntermediateHow do you trigger AWX jobs from CI or other systems?IntermediateHow do project updates work in AWX, and what does "update revision on launch" trade off?Intermediate