{"id":21400315,"url":"https://github.com/oefenweb/ansible-keepalived","last_synced_at":"2025-07-13T21:31:22.706Z","repository":{"id":29412077,"uuid":"32947581","full_name":"Oefenweb/ansible-keepalived","owner":"Oefenweb","description":"Ansible role to set up keepalived in Debian-like systems","archived":false,"fork":false,"pushed_at":"2023-11-02T11:04:15.000Z","size":175,"stargazers_count":31,"open_issues_count":2,"forks_count":28,"subscribers_count":5,"default_branch":"master","last_synced_at":"2023-11-02T11:37:08.487Z","etag":null,"topics":["ansible","debian","ha","keepalived","ubuntu","vrrp-instance","vrrp-script"],"latest_commit_sha":null,"homepage":"","language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Oefenweb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2015-03-26T19:26:58.000Z","updated_at":"2023-10-26T20:07:21.000Z","dependencies_parsed_at":"2023-01-14T14:52:21.459Z","dependency_job_id":"fb0861c0-21ba-4dc1-ba11-46c594e3a398","html_url":"https://github.com/Oefenweb/ansible-keepalived","commit_stats":null,"previous_names":[],"tags_count":94,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Oefenweb%2Fansible-keepalived","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Oefenweb%2Fansible-keepalived/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Oefenweb%2Fansible-keepalived/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Oefenweb%2Fansible-keepalived/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Oefenweb","download_url":"https://codeload.github.com/Oefenweb/ansible-keepalived/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225917850,"owners_count":17544960,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","debian","ha","keepalived","ubuntu","vrrp-instance","vrrp-script"],"created_at":"2024-11-22T15:20:59.690Z","updated_at":"2024-11-22T15:21:00.241Z","avatar_url":"https://github.com/Oefenweb.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"## keepalived\n\n[![CI](https://github.com/Oefenweb/ansible-haproxy/workflows/CI/badge.svg)](https://github.com/Oefenweb/ansible-keepalived/actions?query=workflow%3ACI)\n[![Ansible Galaxy](http://img.shields.io/badge/ansible--galaxy-keepalived-blue.svg)](https://galaxy.ansible.com/Oefenweb/keepalived)\n\nSet up the latest or a specific version of [Keepalived](http://www.keepalived.org/) in Debian-like systems.\n\n#### Requirements\n\n* `git` (will be installed)\n* `build-essential` (will be installed)\n* `automake` (will be installed)\n* `libtool` (will be installed)\n* `pkg-config` (will be installed)\n* `libssl-dev` (will be installed)\n\nwhen using `keepalived_install_method: native`\n\n* `keepalived` (will be installed)\n* `procps` (will be installed)\n\n#### Variables\n\n* `keepalived_git_repo`: [default: `https://github.com/acassen/keepalived.git`]: Keepalived git repo\n* `keepalived_version`: [default: `v2.2.8`]: Keepalived version to install\n\n* `keepalived_install_method`: [default `git`]: The way to install Keepalived (e.g. `native` (from Ubuntu repo), `git`)\n* `keepalived_install`: [default: `[]`]: Additional packages to install (e.g. `['libnl-3-dev', 'libnl-genl-3-dev', 'libnl-route-3-dev', 'libnfnetlink-dev']`)\n* `keepalived_configure_options`: [default: `[]`]: Options to pass to `./configure`\n\n* `keepalived_options`: [default: `[]`]: Options to pass to the `keepalived`\n* `keepalived_options.{n}.name`: [required]: Option name (e.g. `log-facility`)\n* `keepalived_options.{n}.value`: [optional]: Option value (e.g. `7`)\n\n* `keepalived_ip_nonlocal_bind`: [default: `1`]: Allow to bind to IP addresses that are nonlocal, meaning that they're not assigned to a device on the local system\n\n* `keepalived_create_keepalived_script_user`: [default: `false`]: Whether or not to create the `keepalived_script` user, see `keepalived_global_defs_script_user`\n\n* `keepalived_global_defs_notification_email`: [default: `['root@localhost.localdomain']`]: Email addresses to send alerts to\n* `keepalived_global_defs_notification_email_from`: [default: `'root@localhost.localdomain'`]: From address that will be in header\n* `keepalived_global_defs_smtp_server`: [default: `'127.0.0.1'`]: SMTP server IP address\n* `keepalived_global_defs_smtp_connect_timeout`: [default: `30`]: SMTP server connect timeout in seconds\n* `keepalived_global_defs_script_user`: [optional]: Specify the default user / group to run scripts under. If group is not specified, the group of the user is used. If this option is not specified, the user defaults to `keepalived_script`. If that user exists, otherwise `root` (since `1.3.0`, e.g. `'nobody nogroup'`, )\n* `keepalived_global_defs_enable_script_security`: [optional]: Don't run scripts configured to be run as `root` if any part of the path is writable by a `non-root` user (since `1.3.0`, e.g. `true`)\n* `keepalived_global_defs_raw`: [optional]: An optional list of raw parameters to add to the `global_defs` config section\n\n* `keepalived_vrrp_script_map`: [default: `{}`]: Script declarations\n* `keepalived_vrrp_script_map.key`: [required]: The identifier of the file (e.g. `check-haproxy`)\n* `keepalived_vrrp_script_map.key.src`: [required]: The local path of the file to copy, can be absolute or relative (e.g. `../../../files/keepalived/usr/local/bin/check-haproxy`)\n* `keepalived_vrrp_script_map.key.dest`: [required]: The remote path of the file to copy (e.g. `/usr/local/bin/check-haproxy`)\n* `keepalived_vrrp_script_map.key.owner`: [optional, default `root`]: The name of the user that should own the file\n* `keepalived_vrrp_script_map.key.group`: [optional, default `root`]:The name of the group that should own the file\n* `keepalived_vrrp_script_map.key.mode`: [optional, default `0750`]: The mode of the file\n\n* `keepalived_vrrp_scripts`: [default: `{}`]: VRRP script declarations\n* `keepalived_vrrp_scripts.key`: The name of the VRRP script\n* `keepalived_vrrp_scripts.key.script`: The script to run periodically\n* `keepalived_vrrp_scripts.key.weight`: [optional]: The check weight to adjust the priority\n* `keepalived_vrrp_scripts.key.interval`: [optional]: The check interval in seconds\n* `keepalived_vrrp_scripts.key.timeout`: [optional]: Seconds after which script is considered to have failed\n* `keepalived_vrrp_scripts.key.rise`: [optional]: Required number of successes for OK transition\n* `keepalived_vrrp_scripts.key.fall`: [optional]: Required number of successes for KO transition\n\n* `keepalived_vrrp_track_processes`: [default: `{}`]: VRRP process declarations\n* `keepalived_vrrp_track_processes.key`: The name of the VRRP script\n* `keepalived_vrrp_track_processes.key.process`: The process to monitor (with optional parameters)\n* `keepalived_vrrp_track_processes.key.param_match`: [optional]: If matching parameters, this specifies a `partial` match (i.e. the first n parameters match exactly), or an `initial` match, i.e. the last parameter may be longer that the parameter configured\n* `keepalived_vrrp_track_processes.key.weight`: [optional]: The check weight to adjust the priority\n* `keepalived_vrrp_track_processes.key.quorum`: [optional]: Minimum number of processes for success\n* `keepalived_vrrp_track_processes.key.quorum_max`: [optional]: Maximum number of processes for success\n* `keepalived_vrrp_track_processes.key.fork_delay`: [optional]: Time to delay after process quorum gained after fork before consider process up\n* `keepalived_vrrp_track_processes.key.terminate_delay`: [optional]: Time to delay after process quorum lost before consider process down\n* `keepalived_vrrp_track_processes.key.delay`: [optional]: This sets `fork_delay` and `terminate_delay`\n* `keepalived_vrrp_track_processes.key.full_command`: [optional]: Normally process string is matched against the process name, as shown on the `Name`: line in `/proc/PID/status`, unless parameters are specified\n\n* `keepalived_vrrp_instances`: [default: `{}`]: VRRP instance declarations\n* `keepalived_vrrp_instances.key`: The name of the VRRP instance\n* `keepalived_vrrp_instances.key.interface`: Interface bound by VRRP\n* `keepalived_vrrp_instances.key.state`: Start-up default state (`MASTER|BACKUP`). As soon as the other machine(s) come up, an election will be held and the machine with the highest `priority` will become `MASTER`\n* `keepalived_vrrp_instances.key.priority`: For electing `MASTER` highest priority (`0...255`) wins\n* `keepalived_vrrp_instances.key.virtual_router_id`: Arbitrary unique number (`0...255`) used to differentiate multiple instances of VRRPD running on the same NIC (and hence same socket)\n* `keepalived_vrrp_instances.key.advert_int`: [optional]: The advert interval in seconds\n* `keepalived_vrrp_instances.key.smtp_alert`: [optional]: Whether or not to send email notifications during state transitioning-\n* `keepalived_vrrp_instances.key.authentication`: [optional]: Authentication block\n* `keepalived_vrrp_instances.key.authentication.auth_type`: Simple password or IPSEC AH (`PASS|AH`)\n* `keepalived_vrrp_instances.key.authentication.auth_pass`: Password string (up to 8 characters)\n* `keepalived_vrrp_instances.key.virtual_ipaddresses`: VRRP IP address block\n* `keepalived_vrrp_instances.key.virtual_ipaddresses_excluded`: IP address block, which is not included in the VRRP packet itself, in order to support more than 20 ips\n* `keepalived_vrrp_instances.key.virtual_routes:`: [optional]: List of virtual route added when the VIP is added\n* `keepalived_vrrp_instances.key.nopreempt`: [optional]: VRRP will normally preempt a lower priority machine when a higher priority machine comes online. This option allows the lower priority machine to maintain the master role, even when a higher priority machine comes back online. **NOTE:** For this to work, the initial state of this entry must be `BACKUP`\n* `keepalived_vrrp_instances.key.preempt_delay`: [optional]: Seconds after startup until preemption (if not disabled by `nopreempt`). Range: 0 (default) to 1000 **NOTE:** For this to work, the initial state of this entry must be BACKUP\n* `keepalived_vrrp_instances.key.track_interfaces`: [optional]: Interface states we monitor\n* `keepalived_vrrp_instances.key.track_scripts`: [optional]: Scripts state we monitor\n* `keepalived_vrrp_instances.key.track_processes`: [optional]: Processes state we monitor\n\n* `keepalived_vrrp_instances.key.notify`: [optional]: Scripts that is invoked when a server changes state\n* `keepalived_vrrp_instances.key.notify_user`: [optional]: Specify the user / group to run this script under (since `1.3.0`, e.g. `'nobody nogroup'`)\n* `keepalived_vrrp_instances.key.notify_backup`: [optional]: Scripts that is invoked when a server changes state (to `BACKUP`)\n* `keepalived_vrrp_instances.key.notify_backup_user`: [optional]: Specify the user / group to run this script under (since `1.3.0`)\n* `keepalived_vrrp_instances.key.notify_fault`: [optional]: Scripts that is invoked when a server changes state (to `FAULT`)\n* `keepalived_vrrp_instances.key.notify_fault_user`: [optional]: Specify the user / group to run this script under (since `1.3.0`)\n* `keepalived_vrrp_instances.key.notify_master`: [optional]: Scripts that is invoked when a server changes state (to `MASTER`)\n* `keepalived_vrrp_instances.key.notify_master_user`: [optional]: Specify the user / group to run this script under (since `1.3.0`)\n* `keepalived_vrrp_instances.key.unicast_peer`: [optional]: List of IP addresses if you want to override participating unicast peers (if you don't want to use multicast)\n* `keepalived_vrrp_instances.key.unicast_src_ip`: [optional]: IP source address to use for multicast or unicast vrrp packets\n* `keepalived_vrrp_instances.key.vmac_xmit_base`: [default: `false`]: Forces VRRP to use the physical interface MAC address as source when it sends its own packets.\n* `keepalived_vrrp_instances.key.raw_options`: [optional]: An optional list of raw parameters to add to the vrrp instance\n\n* `keepalived_vrrp_sync_groups`: [default: `{}`]: VRRP group instance declarations\n* `keepalived_vrrp_sync_groups.key`: The name of the VRRP group instance\n* `keepalived_vrrp_sync_groups.key.instances:`: List of vrrp instances for this group\n* `keepalived_vrrp_sync_groups.notify_master`: [optional]: Scripts that is invoked when VRRP group changes state (to `MASTER`)\n* `keepalived_vrrp_sync_groups.key.notify_backup`: [optional]: Scripts that is invoked when VRRP group changes state (to `BACKUP`)\n* `keepalived_vrrp_sync_groups.key.notify_fault`: [optional]: Scripts that is invoked when VRRP group changes state (to `FAULT`)\n\n#### Dependencies\n\nNone\n\n#### Example (HAProxy)\n\n```yaml\n---\n- hosts: all\n  roles:\n    - oefenweb.keepalived\n  vars:\n    keepalived_options:\n      - name: log-detail\n    keepalived_vrrp_scripts:\n      chk_haproxy:\n        script: '/usr/bin/pgrep haproxy'\n        weight: 2\n        interval: 1\n\n    keepalived_vrrp_instances:\n      VI_1:\n        interface: eth1\n        state: MASTER\n        priority: 101\n        virtual_router_id: 51\n\n        authentication:\n          auth_type: PASS\n          auth_pass: '4Apr3C*d'\n\n        virtual_ipaddresses:\n          - '10.0.0.10/24 dev eth1 label eth1:1'\n\n        track_interfaces:\n          - eth0 weight 10\n\n        track_scripts:\n          - chk_haproxy\n\n        raw_options:\n          - dont_track_primary\n```\n\n#### License\n\nMIT\n\n#### Author Information\n\nMischa ter Smitten\n\n#### Feedback, bug-reports, requests, ...\n\nAre [welcome](https://github.com/Oefenweb/ansible-keepalived/issues)!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foefenweb%2Fansible-keepalived","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foefenweb%2Fansible-keepalived","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foefenweb%2Fansible-keepalived/lists"}