Configure playbooks to use source control management (SCM) systems
Choose one of the following options when managing playbooks by using source control:
Configure playbooks to use Git and Subversion SCM types Copy linkLink copied!
Configure automation controller projects to synchronize Ansible playbooks directly from Git and Subversion. Integrating with Source Control Management supports collaboration and helps ensure you always deploy the latest automation code.
About this task Copy linkLink copied!
By following these steps, you can ensure your environment always uses the latest version of your playbooks directly from your chosen SCM.
Procedure Copy linkLink copied!
Configure playbooks to use Red Hat Lightspeed Copy linkLink copied!
Configure your projects to retrieve Ansible playbooks directly from Red Hat Lightspeed. Integrate with Red Hat Lightspeed to manage and deploy remediation playbooks identified through its analysis of your Red Hat Enterprise Linux environment.
About this task Copy linkLink copied!
This integration streamlines the process of addressing identified vulnerabilities and optimizing system configurations, ensuring your automation aligns with best practices and security recommendations.
Procedure Copy linkLink copied!
Configure playbooks to use a remote archive Copy linkLink copied!
Playbooks that use a remote archive enable projects to be based on a build process that produces a versioned artifact, or release, containing all the requirements for that project in a single archive.
Procedure Copy linkLink copied!
Updating projects from source control Copy linkLink copied!
Regularly updating your projects ensures your Ansible Automation Platform environment is synchronized with the latest versions of playbooks, roles, and collections from your integrated SCM repositories.
Procedure Copy linkLink copied!
Results Copy linkLink copied!
This brings you to the Output tab of the Jobs section.
Reuse prebuilt automation by referencing roles Copy linkLink copied!
At the end of a project update, automation controller searches for the requirements.yml file in the roles directory, located at <project-top-level-directory>/roles/requirements.yml.
If this file is found, the following command automatically runs:
ansible-galaxy role install -r roles/requirements.yml -p <project-specific cache location>/requirements_roles -vvv
This file enables you to reference Ansible Galaxy roles or roles within other repositories which can be checked out in conjunction with your own project. The addition of Ansible Galaxy access eliminates the need to create git submodules to achieve this result. Given that SCM projects, along with roles or collections, are pulled into and executed from a private job environment, a <private job directory> specific to the project within /tmp is created by default.
The cache directory is a subdirectory inside the global projects folder. You can copy the content from the cache location to <job private directory>/requirements_roles.
By default, automation controller has a system-wide setting that enables you to dynamically download roles from the roles/requirements.yml file for SCM projects. You can turn off this setting in the Job Settings screen from the navigation panel , by unchecking the Enable Role Download box.
Whenever a project synchronization runs, automation controller determines if the project source and any roles from Galaxy or Collections are out of date with the project. Project updates download the roles inside the update.
If jobs need to pick up a change made to an upstream role, updating the project ensures that this happens. A change to the role means that a new commit was pushed to the provision-role source control.
To make this change take effect in a job, you do not have to push a new commit to the playbooks repository. You must update the project, which downloads roles to a local cache.
For instance, say you have two git repositories in source control. The first one is playbooks and the project in automation controller points to this URL. The second one is provision-role and it is referenced by the roles/requirements.yml file inside of the playbooks git repository.
Jobs download the most recent roles before every job run. Roles and collections are locally cached for performance reasons. You must select Update revision on launch in the project Options to ensure that the upstream role is re-downloaded before each job run:
The update happens much earlier in the process than the sync, so this identifies errors and details faster and in a more logical location.
If there are any directories that must be specifically exposed, you can specify those in the Job Settings screen from the navigation panel , in Paths to expose to isolated Jobs. You can also update the following entry in the settings file:
AWX_ISOLATION_SHOW_PATHS = ['/list/of/', '/paths']
If your playbooks need to use keys or settings defined in AWX_ISOLATION_SHOW_PATHS, you must add AWX_ISOLATION_SHOW_PATHS to /var/lib/awx/.ssh.
If you made changes in the settings file, be sure to restart services with the automation-controller-service restart command after your changes have been saved.
In the UI, you can configure these settings in the Jobs Settings window.