Skip to content

Commit

Permalink
Version 3.0.0 (#18)
Browse files Browse the repository at this point in the history
* Update lint and deps

* Move playbook vars into playbook dir

* Fix include_role

* Remove tag

* Added create vpc playbook

* Correct role paths

* Remove unneeded var

* Added changelog
  • Loading branch information
scottharwell authored Nov 6, 2023
1 parent 64bb2d8 commit 5453e29
Show file tree
Hide file tree
Showing 31 changed files with 283 additions and 63 deletions.
17 changes: 12 additions & 5 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
---
profile: basic
quiet: false
verbosity: 1

exclude_paths:
- .cache/
- .github/
- test
- changelogs

enable_list:
- empty-string-compare # opt-in
- no-log-password # opt-in
- no-same-owner # opt-in
- empty-string-compare
- no-log-password
- no-same-owner
- yaml

skip_list:
- role-name[path]
- galaxy[no-changelog]
- package-latest
- yaml[line-length]
- var-naming[no-role-prefix]
3 changes: 0 additions & 3 deletions .ansible-lint-ignore

This file was deleted.

28 changes: 28 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
=========================================================
lab.azure.azure_infrastructure_config_demos Release Notes
=========================================================

.. contents:: Topics

This changelog describes changes after version 2.0.0.

v3.0.0
======

Release Summary
---------------

Updated the collection to match validated patterns.

Major Changes
-------------

- Moved playbooks into playbooks folder so that playbooks may be called from `namespace.collection.playbook` syntax.
- Updated Ansible Lint config.

Breaking Changes / Porting Guide
--------------------------------

- Playbook names have changed.
- Playbook paths have changed.
- Playbooks now reference role by FQRN.
45 changes: 22 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,46 @@
[![Validation CI](https://github.com/ansible-content-lab/aws.infrastructure_config_demos/actions/workflows/validate.yml/badge.svg)](https://github.com/ansible-content-lab/aws.infrastructure_config_demos/actions/workflows/validate.yml)
[![Validation CI](https://github.com/ansible-content-lab/aws.infrastructure_config_demos/actions/workflows/validate.yml/badge.svg)](https://github.com/ansible-content-lab/lab.aws_infrastructure_config_demos/actions/workflows/validate.yml)

# Ansible Collection - aws.infrastructure_config_demos
# Ansible Collection - lab.aws_infrastructure_config_demos

This repository hosts the `aws.infrastructure_config_demos` Ansible Collection.
This repository hosts the `lab.aws_infrastructure_config_demos` Ansible Collection.

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

This content was developed as part of the [Ansible Content Lab for Cloud Content](https://ansible-content-lab.github.io/), a program from the Ansible team to help incubate Ansible cloud use cases from ideation to collections and roles.

## Included Content

<!--start collection content-->
### Roles

Click on the role name to be directed to the README specifically for that role.

| Name | Description |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| [aws.infrastructure_config_demos.create_vm](https://github.com/ansible-content-lab/aws.infrastructure_config_demos/blob/main/roles/create_vm/README.md) | A role to create AWS virtual machines. |
| [aws.infrastructure_config_demos.manage_transit_peered_networks](https://github.com/ansible-content-lab/aws.infrastructure_config_demos/blob/main/roles/manage_transit_peered_networks/README.md) | A role to create a hub-and-spoke VPC networking architecture that includes DMZ and private networks. |
| [aws.infrastructure_config_demos.peer_existing_networks](https://github.com/ansible-content-lab/aws.infrastructure_config_demos/blob/main/roles/peer_existing_networks/README.md) | A role to automate the peering of two or more VPCs through direct peering model. |
| [aws.infrastructure_config_demos.peer_transit_network](https://github.com/ansible-content-lab/aws.infrastructure_config_demos/blob/main/roles/peer_transit_network/README.md) | Peers a VPC into an AWS transit gateway and configures routing rules across all attached VPCs to allow traffic to the newly attached VPC. |
| Name | Description |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| [lab.aws_infrastructure_config_demos.create_vm](https://github.com/ansible-content-lab/aws.infrastructure_config_demos/blob/main/roles/create_vm/README.md) | A role to create AWS virtual machines. |
| [lab.aws_infrastructure_config_demos.manage_transit_peered_networks](https://github.com/ansible-content-lab/aws.infrastructure_config_demos/blob/main/roles/manage_transit_peered_networks/README.md) | A role to create a hub-and-spoke VPC networking architecture that includes DMZ and private networks. |
| [aws.infrastructure_config_demos.peer_existing_networks](https://github.com/ansible-content-lab/lab.aws_infrastructure_config_demos/blob/main/roles/peer_existing_networks/README.md) | A role to automate the peering of two or more VPCs through direct peering model. |
| [aws.infrastructure_config_demos.peer_transit_network](https://github.com/ansible-content-lab/lab.aws_infrastructure_config_demos/blob/main/roles/peer_transit_network/README.md) | Peers a VPC into an AWS transit gateway and configures routing rules across all attached VPCs to allow traffic to the newly attached VPC. |

### Playbooks

| Name | Role(s) Used | Description |
| ----------------------------- | -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| `create_peer_network.yml` | `roles.manage_direct_peered_networks` | A playbook to create a multi-VPC peer network configuration with DMZ and private networks. |
| `delete_peer_network.yml` | `roles.manage_direct_peered_networks` | Deletes AWS resources created in the `create_peer_network` playbook. |
| `peer_networks.yml` | `roles.peer_networks` | Peer two or more VPCs with VPC peering. |
| `create_transit_network.yml` | `roles.manage_transit_peered_networks` | A playbook to create a multi-VPC hub-and-spoke network configuration using a transit gateway with DMZ and private networks. |
| `delete_transit_network.yml` | `roles.manage_transit_peered_networks` | Deletes AWS resources created in the `create_transit_network` playbook. |
| `peer_to_transit_network.yml` | `roles.peer_transit_network` | A playbook to execute the Transit Gateway peering operation in the role used. |
| `create_vm.yml` | N/A | Simple playbook to create an AWS VM. |
| `delete_vm.yml` | N/A | Deletes the VM created in the `create_vm` playbook. |
| Name | Role(s) Used | Description |
| ----------------------------- | -------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| `create_peer_network.yml` | `lab.aws_infrastructure_config_demos.manage_direct_peered_networks` | A playbook to create a multi-VPC peer network configuration with DMZ and private networks. |
| `delete_peer_network.yml` | `lab.aws_infrastructure_config_demos.manage_direct_peered_networks` | Deletes AWS resources created in the `create_peer_network` playbook. |
| `peer_networks.yml` | `lab.aws_infrastructure_config_demos.peer_networks` | Peer two or more VPCs with VPC peering. |
| `create_transit_network.yml` | `lab.aws_infrastructure_config_demos.manage_transit_peered_networks` | A playbook to create a multi-VPC hub-and-spoke network configuration using a transit gateway with DMZ and private networks. |
| `delete_transit_network.yml` | `lab.aws_infrastructure_config_demos.manage_transit_peered_networks` | Deletes AWS resources created in the `create_transit_network` playbook. |
| `peer_to_transit_network.yml` | `lab.aws_infrastructure_config_demos.peer_transit_network` | A playbook to execute the Transit Gateway peering operation in the role used. |
| `create_vm.yml` | N/A | Simple playbook to create an AWS VM. |
| `delete_vm.yml` | N/A | Deletes the VM created in the `create_vm` playbook. |
<!--end collection content-->

#### VM Playbooks

The `aws.infrastructure_config_demos.create_vm` and `aws.infrastructure_config_demos.delete_vm` playbooks demonstrate how you can construct automation to deploy AWS resources that have dependencies on others. The more complex networking roles and playbooks automate building all of the resources, but these playbooks assume that you have existing infrastructure (VPCs, security groups, SSH keys, etc.) that you want to leverage to deploy the EC2 instance. The command below shows how you can use Ansible Navigator to deploy the instance with variables being set both in var files and directly in the CLI.
The `lab.aws_infrastructure_config_demos.create_vm` and `aws.infrastructure_config_demos.delete_vm` playbooks demonstrate how you can construct automation to deploy AWS resources that have dependencies on others. The more complex networking roles and playbooks automate building all of the resources, but these playbooks assume that you have existing infrastructure (VPCs, security groups, SSH keys, etc.) that you want to leverage to deploy the EC2 instance. The command below shows how you can use Ansible Navigator to deploy the instance with variables being set both in var files and directly in the CLI.

```yaml
ansible-navigator run aws.infrastructure_config_demos.create_vm \
ansible-navigator run lab.aws_infrastructure_config_demos.create_vm \
--pae false \
--mode stdout \
--ee true \
Expand All @@ -61,7 +60,7 @@ ansible-navigator run aws.infrastructure_config_demos.create_vm \

#### Create Network Playbooks

The `aws.infrastructure_config_demos.create_peer_network` and `aws.infrastructure_config_demos.create_transit_network` playbooks have another tasks block that will attempt to configure the EC2 resources deployed by the roles a bit farther. When the role completes, EC2 instances in the DMZ will still need to be configured with SSH configuration in order to communicate with EC2 instances in the private network(s).
The `lab.aws_infrastructure_config_demos.create_peer_network` and `lab.aws_infrastructure_config_demos.create_transit_network` playbooks have another tasks block that will attempt to configure the EC2 resources deployed by the roles a bit farther. When the role completes, EC2 instances in the DMZ will still need to be configured with SSH configuration in order to communicate with EC2 instances in the private network(s).

To connect to the DMZ EC2 instance, the `ansible_ssh_private_key_file` variable needs to be set so that the machine running the playbook can connect to the newly created EC2 instance. You may set this variable in any way that Ansible allows, i.e. extra var, host var, etc. It must be set or the configuration step will be skipped. The `ansible_ssh_user` variable is set automatically to the user `ec2-user` that is standard on AWS AMIs.

Expand Down
19 changes: 19 additions & 0 deletions changelogs/.plugin-cache.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
objects:
role: {}
plugins:
become: {}
cache: {}
callback: {}
cliconf: {}
connection: {}
filter: {}
httpapi: {}
inventory: {}
lookup: {}
module: {}
netconf: {}
shell: {}
strategy: {}
test: {}
vars: {}
version: 3.0.0
16 changes: 16 additions & 0 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
ancestor: 2.0.0
releases:
3.0.0:
changes:
breaking_changes:
- Playbook names have changed.
- Playbook paths have changed.
- Playbooks now reference role by FQRN.
major_changes:
- Moved playbooks into playbooks folder so that playbooks may be called from
`namespace.collection.playbook` syntax.
- Updated Ansible Lint config.
release_summary: Updated the collection to match validated patterns.
fragments:
- version-3.yml
release_date: "2023-11-06"
32 changes: 32 additions & 0 deletions changelogs/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
changelog_filename_template: ../CHANGELOG.rst
changelog_filename_version_depth: 0
changes_file: changelog.yaml
changes_format: combined
ignore_other_fragment_extensions: true
keep_fragments: false
mention_ancestor: true
new_plugins_after_name: removed_features
notesdir: fragments
prelude_section_name: release_summary
prelude_section_title: Release Summary
sanitize_changelog: true
sections:
- - major_changes
- Major Changes
- - minor_changes
- Minor Changes
- - breaking_changes
- Breaking Changes / Porting Guide
- - deprecated_features
- Deprecated Features
- - removed_features
- Removed Features (previously deprecated)
- - security_fixes
- Security Fixes
- - bugfixes
- Bugfixes
- - known_issues
- Known Issues
title: lab.azure.azure_infrastructure_config_demos
trivial_section_name: trivial
use_fqcn: true
10 changes: 5 additions & 5 deletions galaxy.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
namespace: aws
name: infrastructure_config_demos
version: 2.1.0
namespace: lab
name: aws_infrastructure_config_demos
version: 3.0.0
readme: README.md
authors:
- Scott Harwell <[email protected]>
Expand All @@ -13,9 +13,9 @@ tags:
- "cloud"
- "aws"
dependencies:
amazon.aws: ">=6.2.0"
amazon.aws: ">=6.5.0"
amazon.cloud: ">=0.4.0"
community.aws: ">=6.1.0"
community.aws: ">=6.3.0"
repository: https://github.com/ansible-content-lab/aws.infrastructure_config_demos
documentation: https://github.com/ansible-content-lab/aws.infrastructure_config_demos
homepage: https://github.com/ansible-content-lab/aws.infrastructure_config_demos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
- name: Test Peer Network Deployment
block:
- name: Create Peer Network
ansible.builtin.import_role:
name: aws.infrastructure_config_demos.manage_direct_peered_networks
ansible.builtin.include_role:
name: lab.aws_infrastructure_config_demos..manage_direct_peered_networks
vars:
manage_direct_peered_networks_operation: create

Expand Down Expand Up @@ -56,7 +56,7 @@

always:
- name: Delete Peer Network
ansible.builtin.import_role:
name: aws.infrastructure_config_demos.manage_direct_peered_networks
ansible.builtin.include_role:
name: lab.aws_infrastructure_config_demos..manage_direct_peered_networks
vars:
manage_direct_peered_networks_operation: delete
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
- name: Test Transit Network Deployment
block:
- name: Create Transit Network
ansible.builtin.import_role:
name: aws.infrastructure_config_demos.manage_transit_peered_networks
ansible.builtin.include_role:
name: lab.aws_infrastructure_config_demos..manage_transit_peered_networks
vars:
manage_transit_peered_networks_operation: create

Expand Down Expand Up @@ -72,7 +72,7 @@

always:
- name: Delete Transit Network
ansible.builtin.import_role:
name: aws.infrastructure_config_demos.manage_transit_peered_networks
ansible.builtin.include_role:
name: lab.aws_infrastructure_config_demos..manage_transit_peered_networks
vars:
manage_transit_peered_networks_operation: delete
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
- name: Test Transit Network Deployment
block:
- name: Create Transit Network
ansible.builtin.import_role:
name: aws.infrastructure_config_demos.peer_transit_networks
ansible.builtin.include_role:
name: lab.aws_infrastructure_config_demos..peer_transit_networks

- name: Check VPCs
amazon.aws.ec2_vpc_net_info:
Expand Down
4 changes: 2 additions & 2 deletions playbooks/create_peer_network.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
fail_msg: "Required variables not set"

- name: Create Peer Networking Model
ansible.builtin.import_role:
name: manage_direct_peered_networks
ansible.builtin.include_role:
name: lab.aws_infrastructure_config_demos.manage_direct_peered_networks
vars:
manage_direct_peered_networks_operation: create

Expand Down
2 changes: 1 addition & 1 deletion playbooks/create_reports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
tasks:
- name: Include reports role
ansible.builtin.include_role:
name: reports
name: lab.aws_infrastructure_config_demos.reports
4 changes: 2 additions & 2 deletions playbooks/create_transit_network.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
fail_msg: "Required variables not set"

- name: Create Transit Networking Model
ansible.builtin.import_role:
name: manage_transit_peered_networks
ansible.builtin.include_role:
name: lab.aws_infrastructure_config_demos.manage_transit_peered_networks
vars:
manage_transit_peered_networks_operation: create

Expand Down
2 changes: 1 addition & 1 deletion playbooks/create_vm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@

- name: Include create vm role
ansible.builtin.include_role:
name: create_vm
name: lab.aws_infrastructure_config_demos.create_vm
Loading

0 comments on commit 5453e29

Please sign in to comment.