Skip to content
Snippets Groups Projects
keepalived.conf.j2 733 B
Newer Older
! Configuration File for keepalived

global_defs {
}

vrrp_instance VI_1 {
Simon Michnowicz's avatar
Simon Michnowicz committed
   {% if inventory_hostname == NAT_master|string() %}
      {% set role = 'MASTER' %}
      {% set priority = '100' %}
Simon Michnowicz's avatar
Simon Michnowicz committed
   {% elif inventory_hostname == NAT_backup1|string() %}
      {% set role = 'BACKUP' %}
      {% set priority = '101' %}
Simon Michnowicz's avatar
Simon Michnowicz committed
   {% elif inventory_hostname == NAT_backup2|string() %}
Simon Michnowicz's avatar
Simon Michnowicz committed
      {% set role = 'BACKUP' %}
      {% set priority = '102' %}
   {% endif %}

    state {{ role }}
    interface mlx0
    virtual_router_id 51
    priority {{ priority }}
    advert_int 1
    authentication {
        auth_type PASS
        auth_pass 1111
    }
    virtual_ipaddress {
        {{ NAT_virtualIP }}/{{ NAT_virtualIP_subnet }} dev mlx0
    }
}