No description
  • Jinja 96.1%
  • Shell 3.9%
Find a file
2023-12-25 19:28:02 +01:00
.github Add monthly test of keepalived 2022-07-15 10:43:39 +02:00
defaults Fixes notifications and tracking scripts (#240) 2022-09-20 11:25:15 +02:00
files Removing OLDSTATE as requested in PR#256. 2022-12-29 10:53:34 +00:00
handlers Use systemd module again 2022-07-14 11:34:58 +02:00
meta Add more meta tags to improve visibility on galaxy 2022-07-15 09:53:17 +02:00
molecule Show debugging information for molecule converge 2022-07-19 14:07:32 +02:00
tasks Don't reload systemd 2023-12-25 19:28:02 +01:00
templates Implement track_process (#278) 2023-05-19 11:36:38 +02:00
tests Improve keepalived-install-example.yml 2023-02-27 12:33:10 +01:00
vars Add support for Rocky Linux 2021-10-11 16:31:03 +08:00
.ansible-lint Do not fail ansible-lint jobs on experimental features 2022-07-12 15:27:40 +02:00
.gitignore Upgrade to latest standards (#44) 2017-06-05 19:45:56 +01:00
.yamllint Add tox testing 2020-11-03 17:46:54 +01:00
ansible210-requirements.text Remove dependencies updates for old ansible 2022-12-29 10:38:17 +00:00
dev-requirements.txt Fix test run for ansible latest (#285) 2023-05-12 08:33:50 +02:00
LICENSE Pre-commit fixups 2019-07-13 09:53:31 -07:00
README.md Cleanup Examples 2022-12-29 11:55:42 +00:00
tox.ini Remove dependencies updates for old ansible 2022-12-29 10:38:17 +00:00
UPGRADE.md Rewrite the multi-os support 2016-05-06 10:57:01 +01:00

Keepalived

This role installs keepalived and configures it according to the variables you'll pass to the role.

Requirements

No fancy requirements. Only package and file management in the role.

Starting with this role version 4.0.0, the following minimum OS versions are required:

  • Ubuntu: 15.04 or above
  • Debian: Jessie or above
  • CentOS: 7 or above

For older OSes, please use a previous version of this role.

Role Variables

By default, this role doesn't configure keepalived, it barely installs it. This way keepalived is fully flexible based on what you give as input. Examples are given in the vars folder. Don't try them immediately, they won't work! (You need to define VIPs, passwords, etc.). The examples are only a source of inspiration.

The main variables are:

  • keepalived_instances: This is a mandatory dict. It gathers information about the vips, the prefered state (master/backup), the VRRIP IDs and priorities, the password used for authentication... This is where things like nopreempt are configured. nopreempt allows to stay in backup state (instead of preempting to configured master) on a master return of availability, after its failure. Please check the template for additional settings support, and original keepalived documentation for their configuration.
  • keepalived_sync_groups: This is an optional dict. It groups items defined in keepalived_instances, and (if desired) allow the configuration of notifications scripts per group of keepalived_instances. Notification scripts are triggered on keepalived's state change and are facultative.
  • keepalived_virtual_servers: This is an optional dict. It sets up a virtual server + port and balances traffic over real_servers given in a sub dict. Checkout the _example.yaml files in vars/ to see a sample on how to use this dict. The official documentation for keepalived's virtual_server can be found here.
  • keepalived_scripts: This is an optional dict where you could have checking scripts that can trigger the notifications scripts.
  • keepalived_bind_on_non_local: This variable (defaulted to "False") determines whether the system that host keepalived will allow its apps to bind on non-local addresses. If you set it to true, this allows apps to bind (and start) even if they don't currently have the VIP for example.

Please check the examples for more explanations on how these dicts must be configured. You can find an example playbook in this README, and other examples in tests/, including examples on the variables configuration.

Other editable variables are listed in the defaults/main.yml. Please read the explanation there if you want to override them. An example of a notification script is also given, in the files folder.

Antoher good source of informations is the official keepalived GIT repo where you can find a fully commented keepalived.conf. Also various official samples are provided.

Dependencies

No dependency

Example Playbook

See it in tests/keepalived-install-example.yml

License

Apache2

Author Information

Jean-Philippe Evrard