Installs keepalived https://keepalived.org
Go to file
Andrea Dell'Amico d0e257c397
Use a variable to define the nopreempt state.
2021-07-25 01:20:50 +02:00
defaults Use a variable to define the nopreempt state. 2021-07-25 01:20:50 +02:00
files Import the old keepalived role. 2020-06-17 18:47:15 +02:00
handlers Import the old keepalived role. 2020-06-17 18:47:15 +02:00
meta Import the old keepalived role. 2020-06-17 18:47:15 +02:00
tasks Create the runtime directory. 2020-06-17 18:55:39 +02:00
templates Import the old keepalived role. 2020-06-17 18:47:15 +02:00
tests Initial commit 2020-06-17 17:48:34 +02:00
vars Initial commit 2020-06-17 17:48:34 +02:00
.gitignore Initial commit 2020-06-17 17:48:34 +02:00
LICENSE Initial commit 2020-06-17 17:48:34 +02:00
README.md Disable nopreempt by default. 2021-07-25 01:14:28 +02:00

README.md

Role Name

A role that installs and configures keepalived.

Role Variables

The most important variables are listed below:

keepalived_install: True
keepalived_enabled: '{{ keepalived_install }}'
keepalived_version: 1.1.20
keepalived_repo: 'ppa:keepalived/stable'
keepalived_pkg_state: latest
# Use 'keepalived={{ keepalived_version }}' if you want a specific version
keepalived_pkgs:
  - keepalived

keepalived_use_unicast: False
keepalived_unicast_src_ip: '{{ ansible_default_ipv4.address }}'
keepalived_unicast_peer_ip:
  - 127.0.0.1
  - 127.0.0.2
keepalived_mcast_addr: 224.0.0.0/8
keepalived_floating_ip1: 127.0.0.1
keepalived_script1_name: keepalived_check_service_status
# We set haproxy as the default because most of our keepalived use is haproxy related
keepalived_service_to_check: 'haproxy'
keepalived_script1_check: '/bin/pidof {{ keepalived_service_to_check }}'
keepalived_instance1_name: 'VRRP_1'
keepalived_interface1_name: '{{ ansible_default_ipv4.interface }}'
keepalived_initial_state: 'MASTER'
keepalived_inst_priority: 100
keepalived_vrouter_id: 51
keepalived_non_local_bind: True

keepalived_enable_script_security: True
keepalived_script_username: keepalived_script
keepalived_script_user_home: '/var/lib/keepalived'
keepalived_runtime_dir: /run/keepalived

keepalived_nagios_check: False
keepalived_notify_script: /usr/local/bin/keepalived_notify
keepalived_check_script: '/usr/local/bin/{{ keepalived_script1_name }}'

# The service must install its own script if it is too complex to be managed by the provided one
keepalived_scripts:
  - name: '{{ keepalived_script1_name }}'
    script: '{{ keepalived_check_script }}'
    # In seconds
    interval: 2
    # Priority increment
    weight: 2

keepalived_instances:
  - name: '{{ keepalived_instance1_name }}'
    interface: '{{ keepalived_interface1_name }}'
    state: '{{ keepalived_initial_state }}'
    vrouter_id: '{{ keepalived_vrouter_id }}'
    notify: '{{ keepalived_notify_script }}'
    priority: '{{ keepalived_inst_priority }}'
    nopreempt: False
    v_addr:
      - '{{ keepalived_floating_ip1 }}'
    track_script:
      - '{{ keepalived_script1_name }}'
    track_interface:
      - '{{ keepalived_interface1_name }}'

Dependencies

None

License

EUPL-1.2

Author Information

Andrea DellAmico, andrea.dellamico@isti.cnr.it