No description
Find a file
semantic-release-bot 796c6e4982 chore(release): 1.10.0 [skip ci]
# [1.10.0](https://github.com/de-it-krachten/ansible-role-keepalived/compare/v1.9.0...v1.10.0) (2026-07-27)

### Bug Fixes

* Refactor due to legacy fact renaming ([8227d80](8227d80a34))
* Standarize vars.yml ([d93a030](d93a03043e))

### Features

* Added support for Ubuntu 26.04 LTS ([54dd44e](54dd44e050))
2026-07-27 10:48:44 +00:00
.github/workflows Update CI 2026-07-23 14:40:16 +02:00
defaults fix: Move sysctl settings to external role 2026-03-14 19:37:59 +01:00
handlers feat: Move to FQCN 2022-10-08 13:57:38 +02:00
meta Update CI 2026-06-09 00:22:35 +02:00
molecule/default fix: Refactor due to legacy fact renaming 2026-07-27 12:08:59 +02:00
tasks fix: Standarize vars.yml 2026-06-07 15:58:42 +02:00
templates fix: Refactor due to legacy fact renaming 2026-07-27 12:08:59 +02:00
.ansible-lint Update CI 2026-06-07 16:57:08 +02:00
.cicd Update CI 2026-06-09 11:01:10 +02:00
.cicd.overwrite Update CI 2026-06-07 16:57:08 +02:00
.collections feat: Add support for Ubuntu 24.04 LTS + Fedora 40 2024-05-31 23:19:26 +02:00
.gitignore feat: Update supported platforms & CI 2024-12-29 02:14:08 +01:00
.releaserc.yml Update CI 2026-03-06 22:43:24 +01:00
.roles feat: Update CI to latest standards 2022-10-09 13:08:44 +02:00
.yamllint feat: Update supported platforms & CI 2024-12-29 02:14:08 +01:00
CHANGELOG.md chore(release): 1.10.0 [skip ci] 2026-07-27 10:48:44 +00:00
README.md Update CI 2026-06-07 16:57:08 +02:00

CI

ansible-role-keepalived

Role for managing keepalived

Dependencies

Roles

None

Collections

  • ansible.posix
  • community.general

Platforms

Supported platforms

  • Red Hat Enterprise Linux 81
  • Red Hat Enterprise Linux 91
  • Red Hat Enterprise Linux 101
  • RockyLinux 8
  • RockyLinux 9
  • RockyLinux 10
  • OracleLinux 8
  • OracleLinux 9
  • OracleLinux 10
  • AlmaLinux 8
  • AlmaLinux 9
  • AlmaLinux 10
  • Debian 11 (Bullseye)
  • Debian 12 (Bookworm)
  • Debian 13 (Trixie)
  • Ubuntu 20.04 LTS
  • Ubuntu 22.04 LTS
  • Ubuntu 24.04 LTS
  • Ubuntu 26.04 LTS

Note: 1 : no automated testing is performed on these platforms

Role Variables

defaults/main.yml


# VRRP broadcast network address
keepalived_broadcast: '224.0.0.0/8'

# list of VRRP instances (virtual/floating IP)
# each item consists of : name, virtual_router_idm cluster_ip, authentication, pass(phrase)
keepalived_vrrp_instances: []

# list of VRRP sync groups
keepalived_vrrp_sync_groups: []

# keepalive role based on ansible role
keepalived_role: "{{ 'master' if (inventory_hostname in groups['keepalived_master']) else 'backup' }}"

# User for running keepalived script
keepalived_script_user: keepalived_script

# global options
keepalived_global_options:
  vrrp_skip_check_adv_addr:
  vrrp_garp_interval: 0
  vrrp_gna_interval: 0
  enable_script_security:
  script_user: "{{ keepalived_script_user }}"

keepalived_vrrp_scripts:
  - name: chk_haproxy
    options:
      script: '"/bin/pidof haproxy"'
      interval: 5
      init_fail:

# Sysctl settings
keepalived_sysctl_settings:
  'net.ipv4.ip_nonlocal_bind': '1'  # Allow binding on non-local addresses

defaults/family-Debian.yml


keepalived_packages:
  - keepalived
  - procps

defaults/family-RedHat.yml


keepalived_packages:
  - ipvsadm
  - keepalived
  - procps

Example Playbook

molecule/default/converge.yml


- name: sample playbook for role 'keepalived'
  hosts: all
  vars:
    keepalived_vrrp_sync_groups:
      - name: SG1
        members:
          - vrrp1
          - vrrp2
    keepalived_vrrp_instances:
      - name: vrrp1
        options:
          interface: eth0
          virtual_router_id: 1
          state: '{{ ''MASTER'' if keepalived_role == ''master'' else ''BACKUP'' }}'
          priority: '{{ 150 if keepalived_role == ''master'' else 100 }}'
          advert_int: 1
          version: 2
        cluster_ip: 172.17.0.100
        authentication: true
        auth_type: PASS
        auth_pass: TEST1
      - name: vrrp2
        options:
          interface: eth0
          virtual_router_id: 2
          state: '{{ ''MASTER'' if keepalived_role == ''master'' else ''BACKUP'' }}'
          priority: '{{ 150 if keepalived_role == ''master'' else 100 }}'
          advert_int: 1
          version: 2
        cluster_ip: 172.17.0.200
        authentication: true
        auth_type: AH
        auth_pass: TEST2
  tasks:
    - name: Include role 'keepalived'
      include_role:
        name: keepalived