Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[bumpversion]
commit = False
tag = False
current_version = 1.3.0
current_version = 1.3.1

[bumpversion:file:galaxy.yml]
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ codeaffen.phpipam Release Notes
.. contents:: Topics


v1.3.1
======

Bugfixes
--------

- fix `KeyError 'section'` bug (https://github.com/codeaffen/phpipam-ansible-modules/issues/41)

v1.3.0
======

Expand Down
7 changes: 7 additions & 0 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,10 @@ releases:
fragments:
- same_subnet_in_different_sections.yml
release_date: '2020-11-23'
1.3.1:
changes:
bugfixes:
- fix `KeyError 'section'` bug (https://github.com/codeaffen/phpipam-ansible-modules/issues/41)
fragments:
- missing_section_for_addresses.yml
release_date: '2020-11-26'
453 changes: 12 additions & 441 deletions docs/plugins/address_module.rst

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/plugins/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ These are the plugins in the codeaffen.phpipam collection
Modules
-------

* :ref:`address <ansible_collections.codeaffen.phpipam.address_module>` -- Manage addresses
* :ref:`address <ansible_collections.codeaffen.phpipam.address_module>` --
* :ref:`device <ansible_collections.codeaffen.phpipam.device_module>` -- Manage devices
* :ref:`device_type <ansible_collections.codeaffen.phpipam.device_type_module>` -- Manage device types
* :ref:`domain <ansible_collections.codeaffen.phpipam.domain_module>` -- Manage L2 routing domains
Expand Down
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "phpipam"
description: Ansible Modules to manage phpIPAM installations
authors:
- "Christian Meißner <cme+ansible@meissner.sh>"
version: "1.3.0"
version: "1.3.1"
license:
- "GPL-3.0-or-later"
tags:
Expand Down
5 changes: 4 additions & 1 deletion plugins/module_utils/phpipam_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,8 @@ def _auto_resolve_entities(self):
need to be resolved and the id of a resolved entity.
On that way we also convert boolean into int as the api needed this type.
"""
if key in self.phpipam_params:

if key in self.phpipam_params and not spec.get('api_invisible', False):

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

Expand Down Expand Up @@ -275,6 +276,7 @@ def _phpipam_spec_helper(self, spec):
argument_spec = {}

_PHPIPAM_SPEC_KEYS = {
'api_invisible',
'controller',
'flatten',
'phpipam_name',
Expand All @@ -283,6 +285,7 @@ def _phpipam_spec_helper(self, spec):
'separator',
}
_VALUE_SPEC_KEYS = {
'api_invisible',
'controller',
'flatten',
'phpipam_name',
Expand Down
6 changes: 6 additions & 0 deletions plugins/modules/address.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
description: subnet address belongs to
type: str
required: true
section:
description: name of the section the given subnet belongs to
version_added: 1.4.0
typ: str
required: true
ipaddress:
description: IP address to hanle
type: str
Expand Down Expand Up @@ -130,6 +135,7 @@ def main():
module = PhpipamAddressModule(
phpipam_spec=dict(
subnet=dict(type='entity', controller='subnets', required=True, phpipam_name='subnetId'),
section=dict(type='str', api_invisible=True, required=True),
ipaddress=dict(type='str', required=True, aliases=['ip', 'address'], phpipam_name='ip'),
is_gateway=dict(type='bool', phpipam_name='is_gateway'),
description=dict(type='str'),
Expand Down
1 change: 1 addition & 0 deletions tests/test_playbooks/tasks/address.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
username: "{{ phpipam_username }}"
password: "{{ phpipam_password }}"
subnet: "{{ address.subnet }}"
section: "{{ address.section }}"
ipaddress: "{{ address.ipaddress }}"
is_gateway: "{{ address.is_gateway | default(omit) }}"
description: "{{ address.description | default(omit) }}"
Expand Down
1 change: 1 addition & 0 deletions tests/test_playbooks/vars/address.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
base_address_data:
ipaddress: 172.16.0.1
subnet: 172.16.0.0/24
section: Customers
is_gateway: yes