keepalived

keepalived

Source Code General Workflow Readme Workflow Galaxy Workflow License: Apache-2.0 Ansible Role

Ansible role to configure failover IPs via Keepalived.

Building and improving this Ansible role have been sponsored by my current and previous employers like Cloudpunks GmbH and Proact Deutschland GmbH.

Table of content


Requirements

  • Minimum Ansible version: 2.10

Default Variables

keepalived_exporter_args

Optional list of additional arguments for the keepalived exporter

Default value

keepalived_exporter_args: []

keepalived_exporter_download

URL to the keepalived exporter to install

Default value

keepalived_exporter_download: https://github.com/gen2brain/keepalived_exporter/releases/download/v{{
  keepalived_exporter_version }}/keepalived_exporter-{{ keepalived_exporter_version
  }}-amd64.tar.gz

keepalived_exporter_enabled

Enable the installation of the keepalived exporter

Default value

keepalived_exporter_enabled: true

keepalived_exporter_listen_address

Address to bind the exporter to

Default value

keepalived_exporter_listen_address: 0.0.0.0:9650

keepalived_exporter_read_json

Send SIGJSON and decode JSON file instead of parsing text files

Default value

keepalived_exporter_read_json: true

keepalived_exporter_telemetry_path

Path to serve the metrics from

Default value

keepalived_exporter_telemetry_path:

keepalived_exporter_version

Version of the keepalived exporter to install

Default value

keepalived_exporter_version: 0.7.0

keepalived_instances

Definitions for floating IPs

Default value

keepalived_instances: []

Example usage

keepalived_instances:
  - name: haproxy
    interface: ens224
    router: 228
    password: p455w0rd
    script: /usr/bin/killall -0 haproxy
    address:
      - 192.168.1.17/28
    routes:
      - 0.0.0.0/1 via 213.32.231.129 dev ens224
      - 128.0.0.0/1 via 213.32.231.129 dev ens224
    interfaces:
      - ens224
    peers:
      - 192.168.1.18
      - 192.168.1.19
    state:
      haproxy-01: MASTER
      haproxy-02: BACKUP
    priority:
      haproxy-01: 99
      haproxy-02: 98
    notify:
      master: |
        /usr/sbin/route add default gw 192.168.1.1 || true
      backup: |
        /usr/sbin/route delete default gw 192.168.1.1 || true

keepalived_script_group

Group for running scripts

Default value

keepalived_script_group: '{{ keepalived_script_user }}'

keepalived_script_shell

Shell for the script user

Default value

keepalived_script_shell: /usr/sbin/nologin

keepalived_script_user

User for running scripts

Default value

keepalived_script_user: keepalive_script

Discovered Tags

keepalived

keepalived-exporter

Dependencies

  • None

License

Apache-2.0

Author

Thomas Boerger

About

Ansible role to configure failover IPs via Keepalived

Install
ansible-galaxy install rolehippie/keepalived
GitHub repository
License
apache-2.0
Downloads
26
Owner
Ansible role collection of Webhippie