- Clone the repository.
- Make the desired code change.
- Add a changelog fragment to describe your change.
- Run integration tests locally and ensure they pass.
- Create a PR.
The ansible-test
command expects that the repository is in a directory that matches it's collection,
under a directory ansible_collections
. Clone ensuring that hierarchy:
mkdir -p $TARGET_DIR/ansible_collections/google
git clone <url> $TARGET_DIR/collections/google/cloud
- Install the
ansible
package. - Some container runtime is necessary (e.g.
podman
ordocker
). The instructions use podman.
The integration tests for this module require the use of real GCP credentials, and must provide
ansible-test those values. They can be added by authoring the following in tests/integration/cloud-config-gcp.ini
:
[default]
gcp_project: @PROJECT_ID
gcp_cred_file: @CRED_FILE
gcp_cred_kind: @CRED_KIND
gcp_cred_email: @EMAIL
gcp_folder_id: @TEST_FOLDER (to create test projects)
Some of the setup of the project itself is done outside of the test, and is expected to be configured beforehand.
For convenience, a bootstrap script is provided.
NOTE: running this script will make irreversible changes in your GCP project (e.g. create an AppEngine project):
bash ./scripts/bootstrap-project.sh $PROJECT_ID $SERVICE_ACCOUNT_NAME
Run ansible-test integration
. Currently some tests are disabled as test are being verified and added.
If you would like to use podman, you must
install the molecule[podman]
package in PyPI:
pip install --upgrade molecule[podman]
Ansible roles are tested via molecule.
module debug --test -s ${ROLE}
Role is the name of the role (e.g. gcloud, gcsfuse).
Add -d podman
if you would like to use the podman driver.
If the linting fails, that is generally due to ansible-lint
, which can be run directly:
ansible-lint
The following enumerates detailed documentation for specific tasks related tot the codebase.
- modify the ansible-integration-tests.yaml to the version of ansible-core that you would like to test against.
- (optional) update the version of ansible-core version required in meta/runtime.yaml.