We welcome community contributions to this collection.
This guide provides clear instructions for contributors on how to set up their environment for contributing to the cloud.azure_ops
Ansible Collection.
If you find problems, please open an issue or create a Pull Request (PR) against this collection repository.
Make sure you have the following installed on your Machine:
- Python3 and pip3
- Docker or Podman
For more information on how containers are used with Ansible, refer to the Containers section in the Ansible Community Documentation.
To allow managing Docker as a non-root user, refer to the Linux post-installation steps for Docker Engine. - Ansible
This can be installed by running
pip3 install ansible
To set up your environment for contributing to the Cloud Azure Ops Ansible Collection, follow these steps:
NOTE: Make sure to replace
<working directory>
with the actual path where you want to clone the repositories and set up your environment.
-
Clone The "cloud.azure_ops" Ansible Collection:
This repository, includes a variety of Ansible roles and playbooks to help automate the management of resources on Azure.git clone https://github.com/redhat-cop/cloud.azure_ops.git <working directory>/ansible_collections/cloud/azure_ops
-
Clone the "Ansible collection for Azure" repository:
The GitHub repository containing all Ansible Modules and Plugins for interacting with Azure that utilized by the Roles in this repository.git clone https://github.com/ansible-collections/azure.git <working directory>/ansible_collections/azure/azcollection
-
Prepare Azure Configuration File:
Prepare the Azure configuration file at<working directory>/ansible_collections/cloud/azure_ops/tests/integration/cloud-config-azure.ini
. A template of this file is available in the Ansible repository. Populate the file with your appropriate credentials and resource group information.
To run the tests, change directory into azure_ops directory:
cd <working directory>/ansible_collections/cloud/azure_ops
Run Ansible Integration tests, using the following command:
ansible-test integration --docker
To run a specific test, add the test name before the --docker
flag:
ansible-test integration <test name> --docker
The should be replaced with the specific folder name under <working directory>/ansible_collections/cloud/azure_ops/tests/integration/targets/
that you want to test.
Run Ansible Sanity tests, using the following command:
ansible-test sanity --docker
The project uses ansible-lint
and black
.
To execute these tools, run:
tox -e linters