Ansible role for managing AWS VPCs
|
|
||
|---|---|---|
| .forgejo/workflows | ||
| defaults | ||
| meta | ||
| tasks | ||
| tests | ||
| .ansible-lint | ||
| .gitignore | ||
| ansible.cfg | ||
| CHANGELOG.md | ||
| LICENSE | ||
| pyproject.toml | ||
| README.md | ||
| Taskfile.dist.yaml | ||
| uv.lock | ||
AWS VPC Ansible role
This ansible role handles the setup and teardown of an AWS VPC.
Requirements
uv.
Dependencies
See pyproject.toml for the python dependencies and meta/requirements.yaml for the ansible galaxy dependencies.
Role Variables
Required Variables
| Variable | Description | Example |
|---|---|---|
aws_vpc_name |
Name or name prefix for all resources | ansible-role-aws_vpc |
Optional Variables
Optional variables and their defaults are in defaults/main.yaml.
Example Playbook
Setup
---
- name: 'Bootstrap the role test environment'
hosts: 'localhost'
gather_facts: false
tasks:
- name: 'Execute the role main tasks'
ansible.builtin.include_role:
name: 'aws_vpc'
vars:
aws_vpc_name: 'ansible-role-aws_vpc'
Cleanup
---
- name: 'Cleanup the test environment'
hosts: 'localhost'
gather_facts: false
tasks:
- name: 'Execute the role cleanup tasks'
ansible.builtin.include_role:
name: 'aws_vpc'
tasks_from: 'cleanup.yaml'
vars:
aws_vpc_name: 'ansible-role-aws_vpc'
Testing
Run task check for lintint and task test for ansible playbook testing.