Oefenweb.keepalived

Keepalived

CI Ansible Galaxy

This guide helps you install the latest or a specific version of Keepalived on Debian-like systems.

Requirements

You will need the following software, which will be installed automatically:

  • git
  • build-essential
  • automake
  • libtool
  • pkg-config
  • libssl-dev

If you are using keepalived_install_method: native, the following will also be installed:

  • keepalived
  • procps

Variables

  • keepalived_git_repo: [default: https://github.com/acassen/keepalived.git]: Git repository for Keepalived

  • keepalived_version: [default: v2.2.8]: Version of Keepalived to install

  • keepalived_install_method: [default: git]: Method to install Keepalived (e.g. native from the Ubuntu repository, or git)

  • keepalived_install: [default: []]: Extra packages to install (e.g. ['libnl-3-dev', 'libnl-genl-3-dev', 'libnl-route-3-dev', 'libnfnetlink-dev'])

  • keepalived_configure_options: [default: []]: Options for the configuration step

  • keepalived_options: [default: []]: Options for Keepalived

  • keepalived_options.{n}.name: [required]: Name of the option (e.g. log-facility)

  • keepalived_options.{n}.value: [optional]: Value for the option (e.g. 7)

  • keepalived_ip_nonlocal_bind: [default: 1]: Allows binding to nonlocal IP addresses (not assigned to any device on the local system)

  • keepalived_create_keepalived_script_user: [default: false]: If true, will create the keepalived_script user

  • Email notification settings:

    • keepalived_global_defs_notification_email: [default: ['[email protected]']]: Email addresses for alerts
    • keepalived_global_defs_notification_email_from: [default: '[email protected]']: Sender email address
    • keepalived_global_defs_smtp_server: [default: '127.0.0.1']: SMTP server's IP address
    • Other SMTP settings include connection timeout and script user groups.
  • keepalived_vrrp_script_map: [default: {}]: Declarations for scripts to monitor VRRP

  • keepalived_vrrp_scripts: [default: {}]: Configuration for VRRP scripts (like the ones that monitor availability)

  • keepalived_vrrp_instances: [default: {}]: VRRP instance setup

  • keepalived_vrrp_sync_groups: [default: {}]: Groups of VRRP instances for synced configurations

Dependencies

None

Example (HAProxy)

Here’s an example of how to set up Keepalived with HAProxy:

---
- hosts: all
  roles:
    - oefenweb.keepalived
  vars:
    keepalived_options:
      - name: log-detail
    keepalived_vrrp_scripts:
      chk_haproxy:
        script: '/usr/bin/pgrep haproxy'
        weight: 2
        interval: 1

    keepalived_vrrp_instances:
      VI_1:
        interface: eth1
        state: MASTER
        priority: 101
        virtual_router_id: 51

        authentication:
          auth_type: PASS
          auth_pass: '4Apr3C*d'

        virtual_ipaddresses:
          - '10.0.0.10/24 dev eth1 label eth1:1'

        track_interfaces:
          - eth0 weight 10

        track_scripts:
          - chk_haproxy

        raw_options:
          - dont_track_primary

License

MIT License

Author Information

Mischa ter Smitten

Feedback, bug reports, and requests

Your feedback is welcome!

Informazioni sul progetto

Set up keepalived in Debian-like systems

Installa
ansible-galaxy install Oefenweb.keepalived
Licenza
mit
Download
72k
Proprietario