GithubHelp home page GithubHelp logo

ansible_webserver_aws's Introduction

Ansible webserver AWS

Using Ansible to create and configure a simple webserver on AWS

Install Ansible

sudo apt-get update

sudo apt-get install software-properties-common -y

sudo apt-add-repository --yes --update ppa:ansible/ansible

sudo apt-get install ansible -y

Create a Vault file with AWS credentials

ansible-vault create group_vars/all/pass.yml

Include your AWS Key and Secret with permission to create EC2 resources

    ec2_access_key: [ your aws access key ]
    ec2_secret_key: [ your aws secret key ]

Create a second file with the following content to allow Ansible to connect to the EC2 instance(s) identified by their tags

ansible-vault create aws_ec2.yml

With the following content:

plugin: aws_ec2
regions:
  - eu-west-1
filters:
  tag:Name: Webserver
aws_access_key_id: [ your aws access key ]
aws_secret_access_key: [ your aws secret key ]

Dynamic Hosts

aws_ec2.yml is used to determine the host(s) to update based on the Region and a Tag added to the EC2 instance during creation.

To create the AWS infrastructure items

ansible-playbook playbook.yml --ask-vault-pass

To configure the webserver once it has been created

ansible-playbook -i aws_ec2.yml webserver.yml --ask-vault-pass

or

ansible-playbook -i aws_ec2.yml webserver.yml --vault-password-file=vault_password

ansible_webserver_aws's People

Contributors

gordonmurray avatar

Stargazers

 avatar

Watchers

 avatar

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.