From db14d05e6c0ba4dfdc655588ac17419c5832c434 Mon Sep 17 00:00:00 2001
From: Simon Michnowicz <simon.michnowicz@monash.edu>
Date: Thu, 6 May 2021 16:02:14 +1000
Subject: [PATCH] update nat_serve role

---
 roles/nat_server/templates/keepalived.conf.j2 | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/roles/nat_server/templates/keepalived.conf.j2 b/roles/nat_server/templates/keepalived.conf.j2
index dd3c2923..028f847c 100644
--- a/roles/nat_server/templates/keepalived.conf.j2
+++ b/roles/nat_server/templates/keepalived.conf.j2
@@ -4,12 +4,15 @@ global_defs {
 }
 
 vrrp_instance VI_1 {
-   {% if 'login1' in inventory_hostname %}
+   {% if inventory_hostname == {{ NAT_master }} %}
       {% set role = 'MASTER' %}
       {% set priority = '100' %}
-   {% else %}
+   {% elif inventory_hostname == {{ NAT_backup1 }} %}
       {% set role = 'BACKUP' %}
       {% set priority = '101' %}
+   {% elif inventory_hostname == {{ NAT_backup2 }} %}
+      {% set role = 'BACKUP' %}
+      {% set priority = '102' %}
    {% endif %}
 
     state {{ role }}
-- 
GitLab