From 7e6f2f85c78fdcc625f4f3ec6612621ad8f81f90 Mon Sep 17 00:00:00 2001 From: Steven Hodges Date: Fri, 10 Jan 2025 12:17:26 -0600 Subject: [PATCH 1/6] Fix typo --- plugins/modules/section.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/modules/section.py b/plugins/modules/section.py index 4f3b6c1..954c665 100644 --- a/plugins/modules/section.py +++ b/plugins/modules/section.py @@ -122,7 +122,7 @@ def main(): phpipam_spec=dict( name=dict(type='str', required=True), description=dict(type='str', required=False), - parent=dict(type='entity', controller='sections', required=False, defautl=None, phpipam_name='masterSection'), + parent=dict(type='entity', controller='sections', required=False, default=None, phpipam_name='masterSection'), permissions=dict(type='json', required=False, default=None), strict_mode=dict(type='bool', required=False), subnet_ordering=dict(type='bool', required=False, phpipam_name='subnetOrdering'), From 693730d54dd0596cfe99a357d748a44aa0e7c2af Mon Sep 17 00:00:00 2001 From: Steven Hodges Date: Fri, 10 Jan 2025 12:18:15 -0600 Subject: [PATCH 2/6] Update app_id to be not required and set default to ansible as per documentation --- plugins/module_utils/phpipam_helper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/module_utils/phpipam_helper.py b/plugins/module_utils/phpipam_helper.py index 780db23..e7aa6e9 100644 --- a/plugins/module_utils/phpipam_helper.py +++ b/plugins/module_utils/phpipam_helper.py @@ -58,7 +58,7 @@ def __init__(self, **kwargs): self.phpipam_spec, gen_args = self._phpipam_spec_helper(kwargs.pop('phpipam_spec', {})) argument_spec = dict( server_url=dict(required=True, fallback=(env_fallback, ['PHPIPAM_SERVER_URL'])), - app_id=dict(required=True, fallback=(env_fallback, ['PHPIPAM_APP_ID'])), + app_id=dict(required=False, fallback=(env_fallback, ['PHPIPAM_APP_ID']), default='ansible'), username=dict(required=True, fallback=(env_fallback, ['PHPIPAM_USERNAME'])), password=dict(required=True, fallback=(env_fallback, ['PHPIPAM_PASSWORD']), no_log=True), validate_certs=dict(type='bool', fallback=(env_fallback, ['PHPIPAM_VALIDATE_CERTS']), required=False, default=True), From 57b543c006eff0c539593fb35c072592d9a4d360 Mon Sep 17 00:00:00 2001 From: Steven Hodges Date: Fri, 10 Jan 2025 13:10:37 -0600 Subject: [PATCH 3/6] list_order type should be int, not bool --- plugins/modules/section.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/modules/section.py b/plugins/modules/section.py index 954c665..a78dadc 100644 --- a/plugins/modules/section.py +++ b/plugins/modules/section.py @@ -126,7 +126,7 @@ def main(): permissions=dict(type='json', required=False, default=None), strict_mode=dict(type='bool', required=False), subnet_ordering=dict(type='bool', required=False, phpipam_name='subnetOrdering'), - list_order=dict(type='bool', required=False, phpipam_name='order'), + list_order=dict(type='int', required=False, phpipam_name='order'), show_vlan=dict(type='bool', required=False, phpipam_name='showVLAN'), show_vrf=dict(type='bool', required=False, phpipam_name='showVRF'), show_supernets_only=dict(type='bool', required=False, phpipam_name='showSupernetOnly'), From f2aecf383a06211eb854c806e4e1aad78ff07189 Mon Sep 17 00:00:00 2001 From: Steven Hodges Date: Fri, 10 Jan 2025 14:52:23 -0600 Subject: [PATCH 4/6] Typo fix --- docs/plugins/address_module.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/plugins/address_module.rst b/docs/plugins/address_module.rst index d10f9e4..89ef2e7 100644 --- a/docs/plugins/address_module.rst +++ b/docs/plugins/address_module.rst @@ -348,7 +348,7 @@ Parameters
- IP address to hanle + IP address to handle .. raw:: html From 758ed3fb207bac52aff854f110a2569e1e7b030e Mon Sep 17 00:00:00 2001 From: Steven Hodges Date: Wed, 15 Jan 2025 09:48:55 -0600 Subject: [PATCH 5/6] Test section list_order works --- tests/test_playbooks/vars/section.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test_playbooks/vars/section.yml b/tests/test_playbooks/vars/section.yml index 5884d78..cabd4d2 100644 --- a/tests/test_playbooks/vars/section.yml +++ b/tests/test_playbooks/vars/section.yml @@ -5,7 +5,10 @@ base_section_data: sections: - name: "ACME Inc." + list_order: 3 - name: "DevOps Department" parent: "ACME Inc." + list_order: 1 - name: "Infrastructure Department" parent: "ACME Inc." + list_order: 2 From bb583bd8cedc06da491041dd2b077aeecd13a8c3 Mon Sep 17 00:00:00 2001 From: Steven Hodges Date: Wed, 15 Jan 2025 09:52:30 -0600 Subject: [PATCH 6/6] New test to ensure app_id deafults to 'ansible' --- tests/test_playbooks/shared_vars.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tests/test_playbooks/shared_vars.yml diff --git a/tests/test_playbooks/shared_vars.yml b/tests/test_playbooks/shared_vars.yml new file mode 100644 index 0000000..2d7424b --- /dev/null +++ b/tests/test_playbooks/shared_vars.yml @@ -0,0 +1,14 @@ +- name: Shared vars test + hosts: localhost + gather_facts: false + vars_files: + - vars/server.yml + - vars/address.yml + tasks: + - name: Check app_id defaults to 'ansible' + ansible.builtin.include_tasks: tasks/address.yml + vars: + override: + phpipam_app_id: "" + step: create address again, no change + address: '{{ base_address_data }}'