From 033adf8cd5850508b9213515cca10fa11b2c4e90 Mon Sep 17 00:00:00 2001 From: Tim Rupp Date: Sat, 2 Jun 2018 19:09:13 -0700 Subject: [PATCH] More correct fix for status problem (#41045) Status is not being determined right when monitors are enabled but the state is up or down. This patch fixes it. --- lib/ansible/modules/network/f5/bigip_pool_member.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/network/f5/bigip_pool_member.py b/lib/ansible/modules/network/f5/bigip_pool_member.py index 7dd868fea6..eb98adfa64 100644 --- a/lib/ansible/modules/network/f5/bigip_pool_member.py +++ b/lib/ansible/modules/network/f5/bigip_pool_member.py @@ -465,7 +465,7 @@ class ApiParameters(Parameters): def state(self): if self._values['state'] in ['user-up', 'unchecked', 'fqdn-up-no-addr'] and self._values['session'] in ['user-enabled']: return 'present' - elif self._values['state'] == 'down' and self._values['session'] == 'monitor-enabled': + elif self._values['state'] in ['down', 'up'] and self._values['session'] == 'monitor-enabled': return 'present' elif self._values['state'] in ['user-down'] and self._values['session'] in ['user-disabled']: return 'forced_offline' @@ -522,6 +522,8 @@ class ReportableChanges(Changes): def state(self): if self._values['state'] in ['user-up', 'unchecked', 'fqdn-up-no-addr'] and self._values['session'] in ['user-enabled']: return 'present' + elif self._values['state'] in ['down', 'up'] and self._values['session'] == 'monitor-enabled': + return 'present' elif self._values['state'] in ['user-down'] and self._values['session'] in ['user-disabled']: return 'forced_offline' else: