Giter Club home page Giter Club logo

shubhambhardwaj007 / ansible-haproxy-role Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 21 KB

Ansible Role for setting up Haproxy Load Balancer Service on Remote Host and dynamically updating Backend Webserver IP Addresses

Home Page: https://galaxy.ansible.com/shubhambhardwaj007/haproxy_loadbalancer

License: GNU General Public License v3.0

Jinja 100.00%
ansible ansible-role ansible-galaxy haproxy haproxy-configuration load-balancer handler remote-execution local-machine haproxy-loadbalancer hostgroup playbook inventory

ansible-haproxy-role's Introduction

Ansible-Haproxy-Role

Lets understand the Problem Statement:

  1. Create an Ansible Role to Install Haproxy LoadBalancer Software on Remote system.
  2. Dynamically update the Haproxy configuration file with BackEnd Webserver IP Addresses.
  3. Start Haproxy LoadBalancer Service and make Haproxy LoadBalancer Service permanent on reboot.
  4. Add Idempotence to Haproxy LoadBalancer such that on new Changes are made to Haproxy LoadBalancer Configuration file, Haproxy LoadBalancer Service restarts automatically.

To replicate same setup on your Local Machine perform following steps:

  • Install Ansible on local system and this local machine acts as Master Node.
  • Clone this repository on Local Machine and edit ansible.cfg file to add up location where our Role is present using roles_path keyword.
  • Now create Inventory File and Playbook for running this role.Specify Inventory Location in Inventory using inventory.
  • Note that Inventory File must have all Webserver IP Addresses/Domain Name under HostGroup Name webserver and all LoadBalancer IP Address/Domain Name under HostGroup Name loadbalancer.
  • Edit Ansible-Haproxy-Role/vars/main.yml file to tell about Exposed Haproxy LoadBalancer Port Number using variable exposed_port_number.
  • Edit Ansible-Haproxy-Role/vars/main.yml file to tell about Backend Webserver Port Number using variable webserver_port

Finally all things set so it's time to Deploy above complete setup and run below command:

ansible-playbook <name_of_playbook>

ansible-haproxy-role's People

Contributors

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