diff --git a/lib/ansible/modules/network/f5/bigip_iapp_service.py b/lib/ansible/modules/network/f5/bigip_iapp_service.py index 5efd2b9cf2..4848b2f128 100644 --- a/lib/ansible/modules/network/f5/bigip_iapp_service.py +++ b/lib/ansible/modules/network/f5/bigip_iapp_service.py @@ -159,7 +159,8 @@ from deepdiff import DeepDiff class Parameters(AnsibleF5Parameters): returnables = [] api_attributes = [ - 'tables', 'variables', 'template', 'lists' + 'tables', 'variables', 'template', 'lists', 'deviceGroup', + 'inheritedDevicegroup', 'inheritedTrafficGroup', 'trafficGroup' ] updatables = ['tables', 'variables', 'lists'] @@ -282,6 +283,14 @@ class Parameters(AnsibleF5Parameters): self.variables = value['variables'] if 'lists' in value: self.lists = value['lists'] + if 'deviceGroup' in value: + self.deviceGroup = value['deviceGroup'] + if 'inheritedDevicegroup' in value: + self.inheritedDevicegroup = value['inheritedDevicegroup'] + if 'inheritedTrafficGroup' in value: + self.inheritedTrafficGroup = value['inheritedTrafficGroup'] + if 'trafficGroup' in value: + self.trafficGroup = value['trafficGroup'] @property def template(self): diff --git a/test/units/modules/network/f5/fixtures/create_iapp_service_parameters_f5_http.json b/test/units/modules/network/f5/fixtures/create_iapp_service_parameters_f5_http.json index 86a95ecf85..31fce52a7e 100644 --- a/test/units/modules/network/f5/fixtures/create_iapp_service_parameters_f5_http.json +++ b/test/units/modules/network/f5/fixtures/create_iapp_service_parameters_f5_http.json @@ -2,6 +2,10 @@ "name": "http_example", "partition": "Common", "template": "/Common/f5.http", + "inheritedDevicegroup": "true", + "deviceGroup": "none", + "inheritedTrafficGroup": "true", + "trafficGroup": "/Common/traffic-group-local-only", "lists": [ { "name": "irules__irules", diff --git a/test/units/modules/network/f5/test_bigip_iapp_service.py b/test/units/modules/network/f5/test_bigip_iapp_service.py index b87b2104ae..64090c731a 100644 --- a/test/units/modules/network/f5/test_bigip_iapp_service.py +++ b/test/units/modules/network/f5/test_bigip_iapp_service.py @@ -83,6 +83,10 @@ class TestParameters(unittest.TestCase): assert p.name == 'http_example' assert p.partition == 'Common' assert p.template == '/Common/f5.http' + assert p.deviceGroup == 'none' + assert p.inheritedTrafficGroup == 'true' + assert p.inheritedDevicegroup == 'true' + assert p.trafficGroup == '/Common/traffic-group-local-only' def test_module_parameters_lists(self): args = load_fixture('create_iapp_service_parameters_f5_http.json') @@ -197,6 +201,34 @@ class TestParameters(unittest.TestCase): assert p.tables[0]['rows'][0]['row'] == ['12.12.12.12', '80', '0'] assert p.tables[0]['rows'][1]['row'] == ['13.13.13.13', '443', '10'] + def test_api_parameters_device_group(self): + args = dict( + deviceGroup='none' + ) + p = Parameters(args) + assert p.deviceGroup == 'none' + + def test_api_parameters_inherited_traffic_group(self): + args = dict( + inheritedTrafficGroup='true' + ) + p = Parameters(args) + assert p.inheritedTrafficGroup == 'true' + + def test_api_parameters_inherited_devicegroup(self): + args = dict( + inheritedDevicegroup='true' + ) + p = Parameters(args) + assert p.inheritedDevicegroup == 'true' + + def test_api_parameters_traffic_group(self): + args = dict( + trafficGroup='/Common/traffic-group-local-only' + ) + p = Parameters(args) + assert p.trafficGroup == '/Common/traffic-group-local-only' + def test_module_template_same_partition(self): args = dict( template='foo',