No description
Find a file
semantic-release-bot b7ee680f49 chore(release): 1.9.0 [skip ci]
# [1.9.0](https://github.com/de-it-krachten/ansible-role-keepalived/compare/v1.8.0...v1.9.0) (2026-03-15)

### Bug Fixes

* Move sysctl settings to external role ([6db6217](6db6217c46))

### Features

* Drop support for SUSE Linux Enterprise 15 ([68d42ad](68d42ad97f))
2026-03-15 23:14:23 +00:00
.github/workflows Fix CI 2026-03-16 00:04:34 +01: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-03-14 19:37:59 +01:00
molecule/default Fix CI 2026-03-16 00:04:34 +01:00
tasks fix: Move sysctl settings to external role 2026-03-14 19:37:59 +01:00
templates feat: initial release 2022-05-08 14:31:08 +02:00
.ansible-lint feat: Update CI to latest standards 2022-10-09 13:08:44 +02:00
.cicd Fix CI 2026-03-16 00:04:34 +01:00
.cicd.overwrite Update CI 2026-03-14 19:37:59 +01: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.9.0 [skip ci] 2026-03-15 23:14:23 +00:00
README.md Update CI 2026-03-14 19:37:59 +01: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

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