GithubHelp home page GithubHelp logo

vagrant-aws-example's Introduction

Vagrant AWS Plugin and Ansible

Just an example of how to use vagrant-aws and ansible

Requirements

Installation

$ git clone https://github.com/erozario/vagrant-aws-example.git
$ vagrant plugin install vagrant-aws
$ vagrant box add dummy https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box

Configure AWS credentials

Create a file called ‘aws-credentials’ with following content:

export AWS_KEY='your-key'
export AWS_SECRET='your-secret'
export AWS_KEYNAME='your-keyname'
export AWS_KEYPATH='your-keypath'

Write credentials into Environment variables

$ source aws-credentials

Example Vagrantfile

Vagrant.configure("2") do |config|

  config.vm.box = "dummy"

  config.vm.provider :aws do |aws, override|
    aws.access_key_id = ENV['AWS_KEY']
    aws.secret_access_key = ENV['AWS_SECRET']
    aws.keypair_name = ENV['AWS_KEYNAME']
    aws.ami = "ami-ae7bfdb8"
    aws.region = "us-east-1"
    aws.availability_zone = "us-east-1e"
    aws.instance_type = "t2.micro"
    aws.security_groups = "sg-123abc1a"
    aws.subnet_id = "subnet-123abcd12"
    aws.associate_public_ip = true

    aws.tags = {
      'Name'    => 'grafana'
    }

    override.ssh.username = "centos"
    override.ssh.private_key_path = ENV['AWS_KEYPATH']
  end

  config.vm.provision :ansible do |ansible|
    ansible.playbook = "playbook.yml"
  end

end

Example Playbook

- hosts: all
  become: yes
  roles:
    - erozario.grafana 
  vars:
    grafana_admin_user: admin
    grafana_admin_password: grafana
    grafana_plugins_install: [alexanderzobnin-zabbix-app]

Execute

$ vagrant up --provider aws 

License

MIT

Author Information

Linkedin

vagrant-aws-example's People

Contributors

erozario avatar

Stargazers

Roman avatar

Watchers

James Cloos 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.