Skip to content

Commit 6d39c9d

Browse files
authored
Fix address tag resolution (#56)
Tags returned from the API do not have a 'tag' attribute—the tag value is returned in the 'type' attribute. This introduces a special case for tag lookups to allow the filter_by value to be overridden.
1 parent 52591de commit 6d39c9d

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
bug_fixes:
2+
- Fix tag lookups when specified in an `address` task (https://github.com/codeaffen/phpipam-ansible-modules/issues/57)

plugins/module_utils/phpipam_helper.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,8 @@ def _resolve_entity(self, key):
214214
result = self.find_subnet(subnet, mask, self.phpipam_params['section'])
215215
elif controller == 'tools/device_types':
216216
result = self.find_device_type(self.phpipam_params[key])
217+
elif controller == 'tools/tags':
218+
result = self.find_by_key(controller=controller, value=self.phpipam_params[key], key='type')
217219
elif 'tools' in controller or controller in ['vlan', 'l2domains', 'vrf']:
218220
result = self.find_by_key(controller=controller, value=self.phpipam_params[key])
219221
else:

0 commit comments

Comments
 (0)