https://github.com/flaconi/ansible-role-aws-vpc-vgw
Ansible role to create an arbitrary number of VGW's (one per specific VPC) on AWS
https://github.com/flaconi/ansible-role-aws-vpc-vgw
ansible ansible-role aws role vgw virtual-gateway vpc
Last synced: about 1 month ago
JSON representation
Ansible role to create an arbitrary number of VGW's (one per specific VPC) on AWS
- Host: GitHub
- URL: https://github.com/flaconi/ansible-role-aws-vpc-vgw
- Owner: Flaconi
- License: apache-2.0
- Created: 2018-05-28T14:13:54.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-02-13T16:57:10.000Z (over 2 years ago)
- Last Synced: 2023-03-01T19:23:35.048Z (over 2 years ago)
- Topics: ansible, ansible-role, aws, role, vgw, virtual-gateway, vpc
- Language: Python
- Homepage:
- Size: 22.5 KB
- Stars: 2
- Watchers: 24
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ansible role: AWS VPC VGW
This role is able to create any number of Virtual Gateways, each attached to a VPC in AWS.
[](https://travis-ci.org/Flaconi/ansible-role-aws-vpc-vgw)
[](https://github.com/Flaconi/ansible-role-aws-vpc-vgw/tags)
[](https://galaxy.ansible.com/Flaconi/aws-vpc-vgw/)## Requirements
* Ansible 2.5
## Additional variables
Additional variables that can be used (either as `host_vars`/`group_vars` or via command line args):
| Variable | Description |
|-------------------------------------|------------------------------|
| `aws_vpc_vgw_profile` | Boto profile name to be used |
| `aws_vpc_vgw_default_region` | Default region to use |
| `aws_vpc_vgw_vpc_filter_additional` | Additional `key` `val` filter to add to `vpc_filter` and `vpc_name` by default. |## Example definition
VGW's can be created per VPC either by supplying a VPC `name` or a VPC `filter`.
#### Required parameter only
```yml
aws_vpc_vgws:
# Create VGW for a VPC by VPC name
- name: vgw-test-1
vpc_name: devops-test-vpc-1
# Create VGW for a VPC by VPC filter
- name: vgw-test-2
vpc_filter:
- key: "tag:Name"
val: "devops-test-vpc-2"
- key: "tag:env"
val: playground
- key: "tag:department"
val: devops
```#### All available parameter
```yml
# Ensure VPC filter (name or filter) includes that the VPC is created already
# (not pending nor deleted)
aws_vpc_vgw_vpc_filter_additional:
- key: state
val: availableaws_vpc_vgws:
# Create VGW for a VPC by VPC name
- name: vgw-test-1
vpc_name: devops-test-vpc-1
region: eu-central-1
tags:
- key: env
val: playground
- key: department
val: devops
# Create VGW for a VPC by VPC filter
- name: vgw-test-2
vpc_filter:
- key: "tag:Name"
val: "devops-test-vpc-2"
- key: "tag:env"
val: playground
- key: "tag:department"
val: devops
region: eu-central-1
tags:
- key: env
val: playground
- key: department
val: devops
```## Testing
#### Requirements
* Docker
* [yamllint](https://github.com/adrienverge/yamllint)#### Run tests
```bash
# Lint the source files
make lint# Run integration tests with default Ansible version
make test# Run integration tests with custom Ansible version
make test ANSIBLE_VERSION=2.4
```