Code Monkey home page Code Monkey logo

haproxy-nginx's Introduction

haproxy-nginx

Creating HAproxy loadbalancing to two Nginx servers.

Describtion.

This set of Ansible playbooks and roles execute installation and configuration of simple "proof-of-concept" type of the Web service. There is one load balancer based on HAproxy and two Nginx web servers behind it.

Prerequisites.

  1. Three servers with CentOS 6.x installed. According to the Test describtion there are three CentOS 6 hosts. So all playbooks, tasks and settings are set to work exactly with this type of OS. I can add OS recognition function in Ansible but since it is not required I left it as is to save Time and avoid extra lines of code.

  2. According to the task there are following host names and IPv4 addresses set: Test1 - 192.168.30.1 Test2 - 192.168.30.2 Test3 - 192.168.30.3 Because of that I made an inventory "hosts" file with hardcoded IP addresses for the sake of time saving.

  3. Hosts mentioned above have necessary public ssh keys added to the directory "~/.ssh/authorized_keys" of the user under which ssh connection is meant to be in order to Ansible playbooks work.

  4. There are necessary packages like ansible and python installed on the system from which playbooks are going to be executed.

Execution.

The execution of the playbook is quite straitforward.

ansible-playbook deploy.yml -i hosts -u

It is also possible to to copy the "hosts" file to /etc/ansible/ directory. After that it is possible to just run "ansible-playbook deploy.yml" command with the username provided if needed. If the username is equal to th remote user then it is not necessary.

It is also possible to run one of playbooks for either haproxy settings or nginx settings only. Filenames are: haproxy.yml nginx.yml

As far as I tested everything should work just fine. Enjoy :-)

haproxy-nginx's People

Contributors

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