Skip to content

Commit a275bb5

Browse files
authored
Merge pull request #42 from cmeissner/issue/41
Fix #41 and prepare release 1.3.1
2 parents ec7aaaa + 992660a commit a275bb5

File tree

10 files changed

+42
-445
lines changed

10 files changed

+42
-445
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[bumpversion]
22
commit = False
33
tag = False
4-
current_version = 1.3.0
4+
current_version = 1.3.1
55

66
[bumpversion:file:galaxy.yml]

CHANGELOG.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ codeaffen.phpipam Release Notes
55
.. contents:: Topics
66

77

8+
v1.3.1
9+
======
10+
11+
Bugfixes
12+
--------
13+
14+
- fix `KeyError 'section'` bug (https://github.com/codeaffen/phpipam-ansible-modules/issues/41)
15+
816
v1.3.0
917
======
1018

changelogs/changelog.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,10 @@ releases:
7373
fragments:
7474
- same_subnet_in_different_sections.yml
7575
release_date: '2020-11-23'
76+
1.3.1:
77+
changes:
78+
bugfixes:
79+
- fix `KeyError 'section'` bug (https://github.com/codeaffen/phpipam-ansible-modules/issues/41)
80+
fragments:
81+
- missing_section_for_addresses.yml
82+
release_date: '2020-11-26'

docs/plugins/address_module.rst

Lines changed: 12 additions & 441 deletions
Large diffs are not rendered by default.

docs/plugins/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ These are the plugins in the codeaffen.phpipam collection
1414
Modules
1515
-------
1616

17-
* :ref:`address <ansible_collections.codeaffen.phpipam.address_module>` -- Manage addresses
17+
* :ref:`address <ansible_collections.codeaffen.phpipam.address_module>` --
1818
* :ref:`device <ansible_collections.codeaffen.phpipam.device_module>` -- Manage devices
1919
* :ref:`device_type <ansible_collections.codeaffen.phpipam.device_type_module>` -- Manage device types
2020
* :ref:`domain <ansible_collections.codeaffen.phpipam.domain_module>` -- Manage L2 routing domains

galaxy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: "phpipam"
33
description: Ansible Modules to manage phpIPAM installations
44
authors:
55
- "Christian Meißner <cme+ansible@meissner.sh>"
6-
version: "1.3.0"
6+
version: "1.3.1"
77
license:
88
- "GPL-3.0-or-later"
99
tags:

plugins/module_utils/phpipam_helper.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,8 @@ def _auto_resolve_entities(self):
246246
need to be resolved and the id of a resolved entity.
247247
On that way we also convert boolean into int as the api needed this type.
248248
"""
249-
if key in self.phpipam_params:
249+
250+
if key in self.phpipam_params and not spec.get('api_invisible', False):
250251

251252
updated_key = spec.get('phpipam_name', key)
252253

@@ -275,6 +276,7 @@ def _phpipam_spec_helper(self, spec):
275276
argument_spec = {}
276277

277278
_PHPIPAM_SPEC_KEYS = {
279+
'api_invisible',
278280
'controller',
279281
'flatten',
280282
'phpipam_name',
@@ -283,6 +285,7 @@ def _phpipam_spec_helper(self, spec):
283285
'separator',
284286
}
285287
_VALUE_SPEC_KEYS = {
288+
'api_invisible',
286289
'controller',
287290
'flatten',
288291
'phpipam_name',

plugins/modules/address.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@
3333
description: subnet address belongs to
3434
type: str
3535
required: true
36+
section:
37+
description: name of the section the given subnet belongs to
38+
version_added: 1.4.0
39+
typ: str
40+
required: true
3641
ipaddress:
3742
description: IP address to hanle
3843
type: str
@@ -130,6 +135,7 @@ def main():
130135
module = PhpipamAddressModule(
131136
phpipam_spec=dict(
132137
subnet=dict(type='entity', controller='subnets', required=True, phpipam_name='subnetId'),
138+
section=dict(type='str', api_invisible=True, required=True),
133139
ipaddress=dict(type='str', required=True, aliases=['ip', 'address'], phpipam_name='ip'),
134140
is_gateway=dict(type='bool', phpipam_name='is_gateway'),
135141
description=dict(type='str'),

tests/test_playbooks/tasks/address.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
username: "{{ phpipam_username }}"
77
password: "{{ phpipam_password }}"
88
subnet: "{{ address.subnet }}"
9+
section: "{{ address.section }}"
910
ipaddress: "{{ address.ipaddress }}"
1011
is_gateway: "{{ address.is_gateway | default(omit) }}"
1112
description: "{{ address.description | default(omit) }}"

tests/test_playbooks/vars/address.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
base_address_data:
33
ipaddress: 172.16.0.1
44
subnet: 172.16.0.0/24
5+
section: Customers
56
is_gateway: yes

0 commit comments

Comments
 (0)