Skip to content

Instantly share code, notes, and snippets.

@tlhakhan
Created April 15, 2021 18:34
Show Gist options
  • Save tlhakhan/0e7cd84563a3d5248a7a4501454ae6c7 to your computer and use it in GitHub Desktop.
Save tlhakhan/0e7cd84563a3d5248a7a4501454ae6c7 to your computer and use it in GitHub Desktop.
keepalived example
global_defs {
enable_script_security
}
vrrp_script check_script {
script "/usr/bin/systemctl is-active {{ .ServiceName }}.service"
weight 10
interval 3
fall 1
rise 3
user root root
}
vrrp_instance {{ .VirtualRouterInstanceName }} {
state BACKUP
preempt
interface {{ .InterfaceName }}
virtual_router_id {{ .VirtualRouterID }}
priority 100
advert_int 1
virtual_ipaddress {
{{ .SharedIP }}
}
authentication {
auth_type PASS
auth_pass {{ .SharedPassword }}
}
track_script {
check_script
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment