From 846a5386480f8079fc6cfe059b8d4aba01420aa9 Mon Sep 17 00:00:00 2001 From: Matt Hite Date: Wed, 30 Mar 2016 09:29:34 -0700 Subject: [PATCH] Allow port 0 as a valid pool member port --- lib/ansible/modules/extras/network/f5/bigip_pool_member.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/ansible/modules/extras/network/f5/bigip_pool_member.py b/lib/ansible/modules/extras/network/f5/bigip_pool_member.py index 865478206c6..d1b8ff487e2 100644 --- a/lib/ansible/modules/extras/network/f5/bigip_pool_member.py +++ b/lib/ansible/modules/extras/network/f5/bigip_pool_member.py @@ -371,11 +371,11 @@ def main(): # sanity check user supplied values - if (host and not port) or (port and not host): + if (host and port is None) or (port is not None and not host): module.fail_json(msg="both host and port must be supplied") - if 1 > port > 65535: - module.fail_json(msg="valid ports must be in range 1 - 65535") + if 0 > port or port > 65535: + module.fail_json(msg="valid ports must be in range 0 - 65535") try: api = bigip_api(server, user, password, validate_certs) @@ -457,4 +457,3 @@ def main(): from ansible.module_utils.basic import * from ansible.module_utils.f5 import * main() -