GithubHelp home page GithubHelp logo

ansible-aws-vpc's Introduction

ansible-aws-vpc

Simple Ansible role for management AWS VPC. This role create:

  • AWS VPC
  • Subnets in region availability zones
  • IGW
  • Simple security group. Open tcp port 80, 443, 22 for world and all traffic for VPC cidkblock.

Requirements

Ansible >= 2.4.0.0
boto
boto3
botocore
json

Role Variables

In vars/main.yml

Example vars

vpc:
  #Name of VPC 
  aws_vpc_name: "example-vpc"
  #AWS region for example
  aws_vpc_region: "eu-central-1"
  #AWS availability zones in region for example
  aws_vpc_az_a: "eu-central-1a"
  aws_vpc_az_b: "eu-central-1b"
  aws_vpc_az_c: "eu-central-1c"
  #AWS VPC cidr block for example
  aws_vpc_cidrblock: "10.0.0.0/16"
  #AWS VPC subnets in availability zone from vpc cidr block
  aws_vpc_subnet_az_a: "10.0.0.0/24"
  aws_vpc_subnet_az_b: "10.0.1.0/24"
  aws_vpc_subnet_az_c: "10.0.2.0/24"

Example Playbook

Export enviroment variables with AWS credentials:

export AWS_ACCESS_KEY_ID=YOUR_AWS_ACCESS_KEY_ID
export AWS_SECRET_ACCESS_KEY=YOUR_AWS_SECRET_ACCESS_KEY

Create dir when you clone ansible role from github:

mkdir -p example/Roles
cd example

Clone role repository from github and configure ansible:

cd Roles
git clone https://github.com/unicanova/ansible-aws-vpc
cd ..

Edit ansible.cfg

[defaults]
hostfile = ./hosts.cfg
remote_user = root
host_key_checking = False
timeout = 5
pipelining = True
roles_path = Roles

Edit site.yaml

- hosts: 127.0.0.1
  connection: local
  roles:
   - { role: ansible-aws-vpc, tags: 'test' }

Run anisble:

ansible-playbook site.yaml -t test

License

MIT

Author Information

Author: Sergey Ovsienko

Email: [email protected]

Company: UnicaNova

Website: https://unicanova.com/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.