GithubHelp home page GithubHelp logo

hifis-net / ansible-role-keepalived Goto Github PK

View Code? Open in Web Editor NEW
11.0 2.0 3.0 362 KB

:warning: PLEASE NOTE: This role has been migrated to our hifis.toolkit collection. :warning: A role to set up Keepalived in a high availability and scalability context.

Home Page: https://galaxy.ansible.com/ui/repo/published/hifis/toolkit/

License: Other

Jinja 100.00%
ansible keepalived

ansible-role-keepalived's Introduction

Keepalived Role

⚠️ This project is archived! ⚠️

This role has been migrated to our hifis.toolkit collection:

CI Status Ansible Role: hifis.keepalived Ansible Role Downloads Apache-2.0 Licensed Latest release

Ansible role to set up Keepalived in a high availability and scalability context.

Currently supported platforms are:

  • Ubuntu 22.04 LTS
  • Ubuntu 20.04 LTS

Requirements

None.

Role Variables

Required variables which are not set by default

Keepalived instance unicast peer IP addresses

Set the unicast peer IP addresses of the Keepalived instance:

keepalived_unicast_peers: 
  - '192.168.33.15'
  - '192.168.33.16'

Keepalived instance virtual IP address

Set the virtual IP address of the Keepalived instance:

keepalived_virtual_ip_address: '192.168.33.100'

Optional: List of virtual IP address configs

If you need to configure multiple virtual IP addresses you can define this optional variable. This takes precedence over keepalived_virtual_ip_address.

keepalived_virtual_ipaddress_configs:
  - "10.0.10.15 dev eth0"
  - "10.0.11.15 dev eht1"

All other Default Variables

Keepalived version

Variable to pin the Keepalived version to a certain value:

keepalived_version: '2.2.8'

List of dependencies of Keepalived

List of Keepalived dependencies to be installed:

keepalived_dependencies:
  - 'build-essential'
  - 'curl'
  - 'gcc'
  - 'libssl-dev'
  - 'libnl-3-dev'
  - 'libnl-genl-3-dev'
  - 'libsnmp-dev'

Keepalived executable path

Path to the Keepalived executable:

keepalived_executable_path: '/usr/local/sbin/keepalived'

Keepalived Download URL

URL from which Keepalived can be downloaded:

keepalived_download_url: 'https://www.keepalived.org/software/keepalived-{{ keepalived_version }}.tar.gz'

Keepalived configuration file template name

Name of the template file for Keepalived configuration file

keepalived_conf_template: 'keepalived.conf.j2'

Keepalived configuration directory

Directory which contains Keepalived configuration files:

keepalived_conf_dir: '/etc/keepalived'

Keepalived configuration file path

Path to Keepalived configuration file:

keepalived_conf_file_path: '/etc/keepalived/keepalived.conf'

Keepalived sysconfig file path

Path to Keepalived sysconfig file:

keepalived_sysconfig_file_path: "/etc/keepalived/keepalived.sysconfig"

Systemd service template file name

Name of the template file for Systemd service:

keepalived_service_template: 'keepalived.service.j2'

Keepalived service file path

Path to Keepalived service file:

keepalived_service_file_path: '/etc/systemd/system/keepalived.service'

Keepalived PID file path

Path to the Keepalived PID file:

keepalived_pid_file_path: "/run/keepalived/keepalived.pid"

Configure notification email address

Configure recipient of notification emails:

keepalived_notification_email: 'name@localhost'

Configure notification sender

Configure sender of notification emails:

keepalived_notification_email_from: 'keepalived@localhost'

Configure SMTP Server

Configure IP address or FQDN of SMTP server:

keepalived_smtp_server: '127.0.0.1'

Keepalived instance state MASTER or BACKUP

Set the state of the Keepalived instance to MASTER or BACKUP:

keepalived_state: 'BACKUP'

Keepalived instance priority

Set the priority of the Keepalived instance:

keepalived_priority: '99'

Keepalived maximum increased automatic priority

Maximum priority to which Keepalived can automatically increase (must be in range [0, 99] or -1 to disable):

keepalived_max_auto_priority: '99'

Keepalived instance router ID

Set unique name of the Keepalived router:

keepalived_router_id: 'KEEPALIVED_2'

Keepalived instance weight

Adjust the priority by this weight:

keepalived_weight: '0'

Keepalived instance unicast source IP address

Set the unicast source IP address of the Keepalived instance:

keepalived_unicast_src_ip: '{{ ansible_default_ipv4.address }}'

Keepalived instance network interface

Set network interface to which the floating IP address is associated:

keepalived_interface: "{{ ansible_default_ipv4.interface }}"

Keepalived instance virtual IP address and network interface

Set the virtual IP address and network interface of the Keepalived instance:

keepalived_virtual_ipaddress_config: "{{ keepalived_virtual_ip_address }} dev {{ keepalived_interface }}"

Keepalived instance authentication password

Set the authentication password of the Keepalived instance:

keepalived_auth_pass: 'changeme'

Enable script security

Flag to enable script security to prevent script to run by root user if any part of the path is writable by a non-root user:

keepalived_set_script_security_flag: true

User for executing Keepalived script

Specify username to run Keepalived script under:

keepalived_script_user: 'haproxy'

Group for executing Keepalived script

Specify groupname to run Keepalived script under:

keepalived_script_group: 'haproxy'

Flag to activate process tracking

Activate process tracking in keepalived config:

keepalived_enable_process_tracking: true

Define which process shall be tracked

keepalived_track_process: 'haproxy'

Flag to activate a script to be executed

Activate script that is executed by Keepalived:

keepalived_activate_script: false

Name of the script to be executed

Specify the script name to be executed by Keepalived:

keepalived_script_name: 'chk_haproxy_process'

Command of the script to be executed

Specify the command to be executed by Keepalived:

keepalived_script_command: '/usr/bin/killall -0 haproxy'

Dependencies

None.

Note: This role is intended for use with, but not limited to, the hifis.haproxy role.

Example Playbook

- hosts: loadbalancers
  roles:
    - role: hifis.keepalived
      vars:
        keepalived_virtual_ip_address: '192.168.33.100'
        keepalived_unicast_peers:
          - '192.168.33.15'
          - '192.168.33.16'

License

Apache-2.0

Author Information

HIFIS Software Services Team

ansible-role-keepalived's People

Contributors

christianhueserhzdr avatar dependabot[bot] avatar normo avatar renovate-bot avatar tobiashuste avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ansible-role-keepalived's Issues

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.