Keeping track of changes in your Ansible collection is essential for maintaining transparency and informing users about updates, enhancements, and bug fixes.
antsibull-changelog is a powerful tool that streamlines the process of managing changelogs. In this article, we’ll guide you through the steps of setting up and utilizing
antsibull-changelog for your Ansible collection.
The first step is to install
antsibull-changelog. Open your terminal and execute the following command:
pip install antsibull-changelog
antsibull-changelog, navigate to the root directory of your Ansible collection and initialize it:
antsibull-changelog init /path/to/your/collection
This command sets up the necessary directory structure and configuration files to manage changelogs effectively.
Linting: Ensure your changelog adheres to the required format by running the linting command:
The linting process helps identify and rectify any issues in your changelog.
Adding Changelog Fragment
Create a new file in the
changelogs/fragments directory, such as
1.0.0.yaml. Populate this file with details about the changes made in your collection. Use the following template:
This is the first proper release of the ``foo.bar`` collection on 2023-12-04.
The collection contains the ``hello-world`` filter and the ``my_role`` role.
Replace the content within the backticks with your collection name, release date, and a brief summary of the changes.
Releasing a New Version: After adding the changelog fragment, it’s time to release the new version of your Ansible collection: