Giter Site home page Giter Site logo

vagrant-ansible-nginx's Introduction

What?

This vagrantfile (using Virtualbox) creates any number of nginx web-nodes and can provision them using the playbook lb-nginx.yml. By default it will create 3 web nodes and they are fronted by a loadbalancer (also running nginx). If you want to add a new web node, just alter the hosts.yml file to create an extra node, run 'vagrant up' and then the playbook and it is in use.

The provisioning step has been commented out from the Vagrantfile, since it will run for every machine that gets created. So, it is faster to run the playbook manually after the VM's are created. The inventory file is built everytime you run 'vagrant up'. The inventory works but is really ugly, but I dont know ruby, so there.

There is also a small python script (lbtest.py) that makes a configurable number of requests to the loadbalancer to see if the traffic gets balanced properly.

As the playbook is using the Vagrant insecure_private_key, the path should be changed in the hosts.yml file. It is hardcoded to my environment.

Ansible Role Name

nginx - Installs and configures an n-node web cluster fronted by a loadbalancer

Example Playbook

To run the playbook, execute the 'run-ansible-playbook.sh' script and pass in the playbook.

./run-ansible-playbook.sh lb-nginx.yml

To test if loadbalancing is working, run the lbtest.py script:

./lbtest.py -u http://192.168.9.90 -r 300

License

MIT

Author Information

Mikael Sandstrom, [email protected]

vagrant-ansible-nginx's People

Contributors

oravirt avatar

Stargazers

 avatar

Watchers

 avatar  avatar  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.