cloud.terraform_ops roles to create/configure Cloud providers' resources for Red Hat Ansible Automation Platform Terraform integration
This repository hosts the cloud.terraform_ops
Ansible Collection.
The collection includes a variety of Ansible roles, to help automate the management of Cloud providers' resources for Red Hat Ansible Automation Platform Terraform integration.
This collection has been tested against following Ansible versions: >=2.14.0.
This collection requires Python 3.9 or greater.
Click on the name of a role or playbook to view that content's documentation:
Name | Description |
---|---|
cloud.terraform_ops.aws_s3backend | A role to create the necessary AWS infrastructure for an S3 remote backend for Terraform. |
cloud.terraform_ops.gcs_backend | A role to create the necessary Google Cloud infrastructure for a Google Cloud Storage (GCS) remote backend for Terraform. |
cloud.terraform_ops.azurerm_backend | A role to create/delete the necessary Azure infrastructure for an Azurerm remote backend for Terraform. |
cloud.terraform_ops.plan_stash | A role to handle the base64 encoding or decoding of a terraform plan file using cloud.terraform.plan_stash module. |
-
The amazon.aws and community.aws collections MUST be installed to use the role cloud.terraform_ops.aws_s3backend.
-
The google.cloud collection MUST be installed to use the role cloud.terraform_ops.gcs_backend.
-
The azure.azcollection collection MUST be installed to use the role cloud.terraform_ops.azurerm_backend.
-
The cloud.terraform collection MUST be installed to use the role cloud.terraform_ops.plan_stash.
To consume this Validated Content from Automation Hub, please ensure that you add the following lines to your ansible.cfg file.
[galaxy]
server_list = automation_hub
[galaxy_server.automation_hub]
url=https://cloud.redhat.com/api/automation-hub/
auth_url=https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token
token=<SuperSecretToken>
The token can be obtained from the Automation Hub Web UI.
Once the above steps are done, you can run the following command to install the collection.
ansible-galaxy collection install cloud.terraform_ops
Once installed, you can reference the cloud.terraform_ops collection content by its fully qualified collection name (FQCN), for example:
- hosts: all
roles:
- role: cloud.terraform_ops.aws_s3backend
aws_s3backend_bucket_name: sample_bucket_for_tf_backend
- Using Ansible collections for more details.
We welcome community contributions to this collection. If you find problems, please open an issue or create a PR against this collection repository.
The project uses ansible-lint
and black
.
Assuming this repository is checked out in the proper structure,
e.g. collections_root/ansible_collections/cloud/terraform_ops/
, run:
tox -e linters -vv
Sanity and unit tests are run as normal:
ansible-test sanity
If you want to run AWS cloud integration tests, ensure you log in :
# using the "default" profile on AWS
aws configure set aws_access_key_id my-access-key
aws configure set aws_secret_access_key my-secret-key
aws configure set region eu-north-1
Once credentials are set up, run all integration tests with ansible-test integration
or run a subset of integration tests with ansible-test integration <target>
.
This collection is tested using GitHub Actions. To know more about CI, refer to CI.md.
GNU General Public License v3.0 or later
See LICENSE to see the full text.