From 4687db56b42bc0b568b068cc5ba2f0072a3ed8f3 Mon Sep 17 00:00:00 2001 From: Adrien Waksberg Date: Sat, 28 Mar 2020 23:15:22 +0100 Subject: [PATCH] chore: update README --- README.md | 59 +++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 53 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index c78d969..b319cb9 100644 --- a/README.md +++ b/README.md @@ -12,10 +12,30 @@ Install and configure Keepalived ## Role variables -* `keepalived_mail_from` - from header for notification mail -* `keepalived_smtp_server` - the smtp server (default: `localhost`) -* `keepalived_notification_mails` - array with the mail to notify -* `keepalived_vrrp_instances` - array with the vrrp instances +| Name | Type | Required |Default | Comment | +|-------------------------------|-------|----------|-----------------------|-----------------------------------| +| keepalived_mail_from | str | no | keepalived@test.local | from header for notification mail | +| keepalived_smtp_server | str | no | localhost | the smtp server | +| keepalived_notification_mails | array | no | | the mail addresses to notify | +| keepalived_vrrp_instances | array | no | | the vrrp instances | +| keepalived_vrrp_scripts | array | no | | the vrrp check scripts | + +### keepalived_vrrp_instances + +| Name | Type | Required | Default | Comment | +|---------------------|-------|----------|---------|----------------------------------------------| +| name | str | yes | | the instance name | +| state | str | yes | | Initial state, MASTER or BACKUP | +| interface | str | yes | | interface for inside_network, bound by vrrp | +| virtual_router_id | int | yes | | arbitrary unique number from 1 to 255 | +| priority | int | yes | | for electing MASTER, highest priority wins | +| smtp_alert | bool | yes | | send SMTP alerts | +| authentication | hash | no | | use an authentication `deprecated` | +| virtual_ipaddresses | array | yes | | addresses add on change to MASTER, to BACKUP | +| track_scripts | array | no | | add a tracking script to the interface | +| notify | hash | no | | notify scripts, alert as above | + +Example: ``` - name: vip_ngninx @@ -36,14 +56,24 @@ Install and configure Keepalived ``` -* `keepalived_vrrp_scripts` - array with the vrrp scripts +### keepalived_vrrp_scripts + +| Name | Type | Required | Default | Comment | +|----------|-------|----------|---------|---------------------------------------| +| name | str | yes | | the script name | +| script | str | yes | | path of the script to execute | +| interval | int | no | 2 | seconds between script invocations | +| fall | int | no | 2 | number of successes for KO transition | +| rise | int | no | 2 | number of successes for OK transition | + +Example: ``` - name: check_nginx script: /usr/local/bin/check_nginx fall: 3 - interval: 10 rise: 5 + interval: 10 ``` ## How to use @@ -52,6 +82,23 @@ Install and configure Keepalived - hosts: server roles: - keepalived + vars: + keepalived_vrrp_scripts: + - name: check_file + script: test -e /path/file + interval: 5 + keepalived_vrrp_instances: + - name: test + state: master + interface: eth0 + virtual_router_id: 5 + priority: 200 + virtual_ipaddresses: + - 172.255.0.254/32 dev eth0 + track_scripts: + - check_file + notify: + master: touch /tmp/keepalived ``` ## Development