diff --git a/octavia/amphorae/drivers/keepalived/jinja/jinja_cfg.py b/octavia/amphorae/drivers/keepalived/jinja/jinja_cfg.py index 9b396fd3cf..a9f40a9d5d 100644 --- a/octavia/amphorae/drivers/keepalived/jinja/jinja_cfg.py +++ b/octavia/amphorae/drivers/keepalived/jinja/jinja_cfg.py @@ -132,7 +132,6 @@ class KeepalivedJinjaTemplater(object): peers_ips.append(amp.vrrp_ip) return self.get_template(self.keepalived_template).render( {'vrrp_group_name': loadbalancer.vrrp_group.vrrp_group_name, - 'amp_role': amphora.role, 'amp_intf': amphora.vrrp_interface, 'amp_vrrp_id': amphora.vrrp_id, 'amp_priority': amphora.vrrp_priority, diff --git a/octavia/amphorae/drivers/keepalived/jinja/templates/keepalived_base.template b/octavia/amphorae/drivers/keepalived/jinja/templates/keepalived_base.template index 3bcb8eda4a..d44f48cbda 100644 --- a/octavia/amphorae/drivers/keepalived/jinja/templates/keepalived_base.template +++ b/octavia/amphorae/drivers/keepalived/jinja/templates/keepalived_base.template @@ -21,7 +21,6 @@ vrrp_script check_script { } vrrp_instance {{ vrrp_group_name }} { - state {{ amp_role }} interface {{ amp_intf }} virtual_router_id {{ amp_vrrp_id }} priority {{ amp_priority }} diff --git a/octavia/tests/unit/amphorae/drivers/keepalived/jinja/test_jinja_cfg.py b/octavia/tests/unit/amphorae/drivers/keepalived/jinja/test_jinja_cfg.py index 15dd2e942b..870ef2a215 100644 --- a/octavia/tests/unit/amphorae/drivers/keepalived/jinja/test_jinja_cfg.py +++ b/octavia/tests/unit/amphorae/drivers/keepalived/jinja/test_jinja_cfg.py @@ -71,7 +71,6 @@ class TestVRRPRestDriver(base.TestCase): "}\n" "\n" "vrrp_instance TESTGROUP {\n" - " state MASTER\n" " interface eth1\n" " virtual_router_id 1\n" " priority 100\n" @@ -124,7 +123,6 @@ class TestVRRPRestDriver(base.TestCase): "}\n" "\n" "vrrp_instance TESTGROUP {\n" - " state MASTER\n" " interface eth1\n" " virtual_router_id 1\n" " priority 100\n" @@ -170,7 +168,6 @@ class TestVRRPRestDriver(base.TestCase): "}\n" "\n" "vrrp_instance TESTGROUP {\n" - " state MASTER\n" " interface eth1\n" " virtual_router_id 1\n" " priority 100\n" @@ -220,7 +217,6 @@ class TestVRRPRestDriver(base.TestCase): "}\n" "\n" "vrrp_instance TESTGROUP {\n" - " state MASTER\n" " interface eth1\n" " virtual_router_id 1\n" " priority 100\n" diff --git a/releasenotes/notes/remove-default-role-from-keepalived-c879bad3a42a6b4a.yaml b/releasenotes/notes/remove-default-role-from-keepalived-c879bad3a42a6b4a.yaml new file mode 100644 index 0000000000..bfca76f83f --- /dev/null +++ b/releasenotes/notes/remove-default-role-from-keepalived-c879bad3a42a6b4a.yaml @@ -0,0 +1,8 @@ +--- +fixes: + - | + Fixed a bug with the `nopreempt` option in keepalived. The option didn't + work properly because the default role of the `MASTER` amphora was set. + Removing the default roles from the configuration files fixed that issue. + Now after a failover, the newly created amphora doesn't preempt the + `MASTER` role from the other amphora.