globalavocado / vagrant-nginx-node

trying out vagrant

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Vagrant with Ansible, Nginx and NodeJS

objectives

This repo can be used to create a Vagrant box, which uses Ansible to deploy two Nginx application servers running a NodeJS 'Hello World' application. It includes verification that Nginx is listening on port 80, as well as giving passwordless sudo access to the vagrant user and sudo rights for all members of the admin group. Extra care was taken that all actions are idempotent and this is largely the case when using Ansible modules. Apart from Vagrant, no other software should be needed on the host machine.

steps

prerequesites

You need to have Vagrant installed on your host machine, which you can get here.

installation and deployment

  1. clone the repo and change into that directory
  ...# git clone git@github.com:globalavocado/vagrant-nginx-node.git
  ...# cd vagrant-nginx-node
  1. start the Vagrant box
  .../vagrant-nginx-node# vagrant up --provision
  1. log into your Vagrant box, change into the directory with the provisioning files and run the playbook
  .../vagrant-nginx-node# vagrant ssh

  ... vagrant@localhost$ cd /provision
  
  ... vagrant@localhost/provision$ sudo ansible-playbook -i hosts playbook.yml
  1. you can now access the NodeJS app in your browser

    http://localhost:8080

  2. log out of your Vagrant box

  ... $ logout

future development

extend it to deploy two application servers, including load balancing and verification that nginx is running on the correct port

About

trying out vagrant


Languages

Language:CSS 92.6%Language:Shell 5.2%Language:HTML 1.2%Language:Nginx 0.8%Language:JavaScript 0.3%