From 95ef456bb75c427239b2200aaa65dd2ed03d31a9 Mon Sep 17 00:00:00 2001 From: Wojciech Wypior Date: Fri, 2 Aug 2019 22:06:07 -0700 Subject: [PATCH] fixes options parameter idempotency issue on v14.x (#60019) --- .../network/f5/bigip_profile_client_ssl.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/lib/ansible/modules/network/f5/bigip_profile_client_ssl.py b/lib/ansible/modules/network/f5/bigip_profile_client_ssl.py index 671a62da49c..852864a4a7f 100644 --- a/lib/ansible/modules/network/f5/bigip_profile_client_ssl.py +++ b/lib/ansible/modules/network/f5/bigip_profile_client_ssl.py @@ -769,14 +769,19 @@ class Difference(object): def options(self): if self.want.options is None: return None + # starting with v14 options may return as a space delimited string in curly + # braces, eg "{ option1 option2 }", or simply "none" to indicate empty set + if self.have.options is None or self.have.options == 'none': + self.have.options = [] + if not isinstance(self.have.options, list): + if self.have.options.startswith('{'): + self.have.options = self.have.options[2:-2].split(' ') + else: + self.have.options = [self.have.options] if not self.want.options: - if self.have.options is None: - return None - if not self.have.options: - return None - if self.have.options is not None: - return self.want.options - if self.have.options is None: + # we don't want options. If we have any, indicate we should remove, else noop + return [] if self.have.options else None + if not self.have.options: return self.want.options if set(self.want.options) != set(self.have.options): return self.want.options