Coder Social home page Coder Social logo

mod-ansible-rpm-loadbalancing's Introduction

loadbalancing

Role installation

create requirements file

cd ANSIBLE_FOLDER
mkdir requirements
touch requirements/loadbalancing.yml

file content

---
# ansible-galaxy install -p vss_galaxy_roles --force -r requirements/loadbalancing.yml
- src: "https://github.com/virsas/mod-ansible-rpm-loadbalancing"
  scm: git
  version: v1.1.1
  name: loadbalancing
  path: vss_galaxy_roles

Install role

Installation

ansible-galaxy install -p galaxy_roles --force -r requirements/loadbalancing.yml

Best practices

If you are using git for your playbooks and sites configuration, add vss_galaxy_roles to your .gitignore file. You are free to download the role directly to your roles directory, but it will be then pushed to your repo too.

Role access

Direct access

$ cd vss_galaxy_roles
$ ls
loadbalancing
$ cd loadbalancing
$ ls -1
defaults
handlers
LICENSE
meta
README.md
tasks
templates
$

Access from ansible (ansible.cfg)

[defaults]
gathering = smart
roles_path=./roles:../roles:../../roles:./vss_galaxy_roles
log_path=./ansible_run.log
retry_files_enabled=False
[ssh_connection]
scp_if_ssh=True
host_key_checking=False

Files

Playbook (./playbooks/loadbalancing.yml)

---
- hosts: loadbalancing
  remote_user: ec2-user
  become: yes
  roles:
    - loadbalancing

Inventory (./sites/NAME/inventory)

[loadbalancing]
loadbalancing_01

Host vars (./sites/NAME/host_vars/loadbalancing_01.yml)

---
ansible_ssh_host: 1.1.1.1

Group vars (./sites/NAME/group_vars/loadbalancing.yml)

Please see the variables below to get the complete list of possible modifications. The YAML file below is just a basic example of a minimal configuration.

---
CERT_EMAIL: [email protected]
CERT_DOMAINS:
  - example.org
  - www.example.org
  - admin-api.example.org

NGINX_BACKENDS:
  - name: admin
    method: ip_hash
    idle_connections: 8
    servers:
      - ip: 172.16.2.4
        port: 8000
NGINX_FRONTEND_PROXIES:
  - domain: admin-api.example.org
    timeout: 30s
    backend: admin
NGINX_FRONTEND_REDIRECTS:
  - domain: www.example.org
    redirect_to: www.example.com/org/

Usage

ansible-playbook -i sites/NAME/inventory playbooks/loadbalancing.yml --diff

Variables

CERT_EMAIL: [email protected]
CERT_DOMAINS:
  - example.com
  - www.example.com
  - api.example.com

# cronjob configuration for renewals
CRON_RENEWAL_MINUTE: 0
CRON_RENEWAL_HOUR: 2

# nginx configuration
NGINX_WORKER_CONNECTIONS: 1024
NGINX_KEEPALIVE_TIMOUT: 65
NGINX_HASH_MAX_SIZE: 4096
NGINX_MAX_BODY_SIZE: 100m
NGINX_SSL_PROTOCOLS: TLSv1.2 TLSv1.3
NGINX_SSL_CIPHERS: "HIGH:!aNULL:!MD5:!DSS"
NGINX_SSL_TIMEOUT: 1m

NGINX_MAX_FAILS: 1
NGINX_FAIL_TIMEOUT: 15s

NGINX_BACKENDS: []
NGINX_FRONTEND_PROXIES: []
NGINX_FRONTEND_REDIRECTS: []

mod-ansible-rpm-loadbalancing's People

Contributors

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