How do you configure instances launched by an Auto Scaling Group?
IntermediateProductionAWX, AAP and Cloud Integration
Answer
Two common patterns when the image is not fully baked:
- AWX provisioning callback: user data calls AWX at boot, and AWX runs the job template against just that host.
#!/bin/bash
curl -s -f -X POST -d "host_config_key=${CONFIG_KEY}" \
https://awx.example.com/api/v2/job_templates/57/callback/
The host must be in the template's inventory, so enable "update on launch" on the inventory source.
ansible-pullin user data: the instance pulls the repo and configures itself, with no central controller involved.
Either way, keep boot-time configuration short. The more you bake into the AMI, the faster and more reliable scale-out becomes; Ansible at boot should only apply instance-specific settings.
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 custom credential types work in AWX?AdvancedHow do you connect AWX to an external secrets manager?IntermediateHow do you trigger AWX jobs from CI or other systems?Intermediate