Install and configure the Ansible code bot
Ansible code bot scans GitHub repositories (collections, roles, playbooks) and proactively creates pull requests with best practice or quality improvement recommendations.
The Ansible code bot was deprecated on October 1, 2025 and will be retired anytime after December 31, 2025. Red Hat is no longer actively maintaining or supporting the component.
Ansible code bot scans your code repositories to recommend code quality improvements. It promotes Ansible best practices while avoiding common errors that can lead to bugs or make code harder to maintain. The bot automatically submits pull requests to the repository, which proactively alerts the repository owner to a recommended change to their content. You can configure Ansible code bot to scan your existing Git repositories (both public and private). Your organization must have an active subscription to Red Hat Ansible Automation Platform to use the Ansible code bot. However, IBM watsonx Code Assistant is not required to use the Ansible code bot.
After the Ansible code bot is installed, it automatically scans the selected repositories that are in Jinja format. Once the scanning is complete, the code bot generates an initial PR for each repository; the initial PR also contains the scan schedule configured to run weekly. You must review the initial PR for the suggested changes and merge the PR. Once the initial PR is merged, the scan schedule is triggered, and the subsequent repository scans are performed weekly. If required, you can change the scan schedule to a daily or monthly cadence.
You can access the Ansible code bot dashboard that displays all your repositories that have the bot installed along with their scan status. From the dashboard, you can start a manual scan, view the scan history, and view the repository. From GitHub, you can configure a schedule to scan your repository at regular intervals, and add or remove a repository from being scanned.
Ansible code bot is supported on the following GitHub versions:
- GitHub.com
- GitHub Enterprise Cloud
Ansible code bot is not supported on GitHub Enterprise Server.
The following examples are code recommendations that the Ansible code bot can suggest:
- Available alternatives for deprecated legacy syntax or implementation patterns
- Module version changes and updates, such as:
- Adding any new required parameters
- Flagging deprecated parameters
- Removing unused parameters
- Applying YAML best practices
- Adding comment blocks
- Fixing casing issues in name fields
Install the Ansible code bot Copy linkLink copied!
Install the Ansible code bot to get code recommendations for your repositories, and then log in to the Ansible code bot dashboard to monitor and manage your repository scans.
Procedure Copy linkLink copied!
Results Copy linkLink copied!
After the Ansible code bot is installed, it automatically scans the selected repositories that are in Jinja format. When the scanning is complete, the code bot generates an initial PR for each repository; the initial PR also contains the scan schedule configured to run weekly.
Perform the following tasks:
- Review the initial PR for the suggested changes, and merge the PR.
After you merge the initial PR, the configured scan schedule is triggered, and the subsequent repository scans are performed weekly.
Note If you do not merge the initial PR, the weekly scan schedule is not triggered and the Ansible code bot dashboard displays the repositories without any associated scan history.
The following illustration is an example of an initial PR being created:

- Optional: If required, you can manually scan your repositories or change the scan schedule to a daily or monthly cadence.
- Modify the scanned repositories.
Uninstall the Ansible code bot Copy linkLink copied!
If you no longer want to use the Ansible code bot, you can uninstall it from GitHub. After the code bot is uninstalled, you can still access the Ansible code bot dashboard but you cannot see the repositories on the dashboard or scan your repositories.
Procedure Copy linkLink copied!
Manage repository scans Copy linkLink copied!
The Ansible code bot dashboard displays a list of your repositories where the code bot is installed, and indicates if the scan schedule is not set, or is set to manual or scheduled scan.
You can scan your Git repository by starting a manual scan, or configure a schedule to scan your repository at regular intervals. After the scan is completed, you can view the scan history. The scan history shows the start time, status, and type of scan. It also includes a link to the pull request if it was created, and the log message if the scan failed. You can also add new repositories for scanning or remove existing repositories from being scanned.
Manually scan the repository from GitHub Copy linkLink copied!
You can manually scan your Git repositories from GitHub if you did not set up a scanning schedule for your Ansible code bot or if you do not want to wait for the next scheduled scan.
About this task Copy linkLink copied!
If you manually scan your repository, and no pull request was created, it is likely so because a duplicate pull request already exists.
Procedure Copy linkLink copied!
Manually scan the repository from the Ansible code bot dashboard Copy linkLink copied!
You can manually scan your Git repositories if you did not set up a scanning schedule for your Ansible code bot or if you do not want to wait for the next scheduled scan.
About this task Copy linkLink copied!
If you manually scan your repository, and no pull request was created, it is likely so because a duplicate pull request already exists.