Skip to content

Latest commit

 

History

History
110 lines (75 loc) · 4.85 KB

README.md

File metadata and controls

110 lines (75 loc) · 4.85 KB

cloud.aws_ops roles/playbooks to demo Ansible on AWS

This repository hosts the cloud.aws_ops Ansible Collection.

The collection includes a variety of Ansible roles and playbooks to help automate the management of resources on AWS.

Ansible version compatibility

This collection has been tested against following Ansible versions: >=2.12.0.

Included content

Click on the name of a role to view that content's documentation:

Roles

Name Description
cloud.aws_ops.aws_setup_credentials A role to define credentials for aws modules.
cloud.aws_ops.awsconfig_detach_and_delete_internet_gateway A role to detach and delete the internet gateway you specify from virtual private cloud.
cloud.aws_ops.awsconfig_multiregion_cloudtrail A role to create/delete a Trail for multiple regions.
cloud.backup_create_plan A role to create an AWS backup plan.
cloud.backup_select_resources A role to select resources to back up with an existing backup plan.
cloud.aws_ops.customized_ami A role to manage custom AMIs on AWS.
cloud.aws_ops.ec2_instance_terminate_by_tag A role to terminate the EC2 instances based on a specific tag you specify.
cloud.aws_ops.enable_cloudtrail_encryption_with_kms A role to encrypt an AWS CloudTrail trail using the AWS Key Management Service (AWS KMS) customer managed key you specify.
cloud.aws_ops.manage_vpc_peering A role to create, delete and accept existing VPC peering connections.

Playbooks

Name Description
cloud.aws_ops.webapp A playbook to create a webapp on AWS.

Installation and Usage

Requirements

The amazon.aws and community.aws collections MUST be installed in order for this collection to work.

Installation

Clone the collection repository.

  mkdir -p ~/.ansible/collections/ansible_collections/cloud/aws_ops
  cd ~/.ansible/collections/ansible_collections/cloud/aws_ops
  git clone https://github.com/redhat-cop/cloud.aws_ops .

Using this collection

Once installed, you can reference the cloud.aws_ops collection content by its fully qualified collection name (FQCN), for example:

  - hosts: all
    tasks:
      - name: Include 'enable_cloudtrail_encryption_with_kms' role
        ansible.builtin.include_role:
          name: cloud.aws_ops.enable_cloudtrail_encryption_with_kms
        vars:
          enable_cloudtrail_encryption_with_kms_trail_name: "{{ cloudtrail_name }}"
          enable_cloudtrail_encryption_with_kms_kms_key_id: "{{ kms_alias }}"

See Also

Contributing to this collection

We welcome community contributions to this collection. If you find problems, please open an issue or create a PR against this collection repository.

Testing and Development

The project uses ansible-lint and black. Assuming this repository is checked out in the proper structure, e.g. collections_root/ansible_collections/cloud/aws_ops/, run:

  tox -e linters

Sanity and unit tests are run as normal:

  ansible-test sanity

If you want to run cloud integration tests, ensure you log in to the cloud:

# 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

  ansible-test integration [target]

This collection is tested using GitHub Actions. To know more about CI, refer to CI.md.

License

GNU General Public License v3.0 or later

See LICENSE to see the full text.