Set up your automation environment for Configuration as Code
Configuration as Code is a way of working where you define and manage the configuration of Ansible Automation Platform using version-controlled configuration files, such as YAML, instead of clicking through the web UI.
Before you begin
- You have a Git account.
- Your platform gateway instance is accessible.
- You have a valid platform gateway token or user credentials for platform gateway authentication. Legacy automation controller PATs are not supported.
- You built and registered your own execution environment. Alternatively, you have available the supported execution environment to run playbooks that use the
ansible.platformcollection. For more information, see Creating and using execution environments.
About this task
Direct API access to individual service components (automation controller, automation hub, and Event-Driven Ansible) is not supported. All CasC playbooks must authenticate through platform gateway. If you previously used automation controller Personal Access Tokens (PATs), replace them with platform gateway tokens. Ensure that the aap_hostname variable in your playbooks points to your platform gateway URL.
For more information about creating tokens, see Adding tokens in Access management and authentication.
As an Ansible content developer, you can use the Configuration as Code approach to apply settings on your automation controller to get the following benefits:
- Predictable job behavior
- Easier and faster scaling to new clusters
- Change history with diffs and rollback capability thanks to version control support
- Faster recovery after outages or migrations
- Reduced risk of errors because changes flow through CI/CD pipelines and pull requests, where peer reviews and automated testing are applied
Procedure
Results
Verify that the resources were created correctly:
-
In the navigation panel, check that you see your created organization:

-
Check that you see your created team, which belongs to the organization and is assigned the correct pre-existing role:

-
Check that you see your created user, which belongs to the organization and is assigned the correct pre-existing role:

-
Check that you see your created custom role, which was assigned the permissions as specified in your RBAC_settings.yml playbook:
