Skip to content

Commit cd10076

Browse files
authored
Fix typo & Fix app_id requirement and default (#124)
* Fix typos Fix typos in `address` and `section` module. Typo in `section` module could have functional impact. * Set default for `app_id` as mentioned in docs Update `app_id` to be not required and set default to ansible as per documentation. * New test to ensure app_id defaults to 'ansible' * Fix test tool chain * make tool chain work with podman too * update db setup script to work with podman * set predictable container names * fix fissues with starting docker-compose in CI * upgrade `docker-compose` before run phpipam-action * pin python to version 3.9 as long we did not found time to test newer versions --------- Co-authored-by: Christian Meißner <[email protected]>
1 parent 54a20f1 commit cd10076

File tree

5 files changed

+41
-3
lines changed

5 files changed

+41
-3
lines changed

docs/plugins/address_module.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ Parameters
348348

349349
<div class="ansible-option-cell">
350350

351-
IP address to hanle
351+
IP address to handle
352352

353353

354354
.. raw:: html

plugins/module_utils/phpipam_helper.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def __init__(self, **kwargs):
5858
self.phpipam_spec, gen_args = self._phpipam_spec_helper(kwargs.pop('phpipam_spec', {}))
5959
argument_spec = dict(
6060
server_url=dict(required=True, fallback=(env_fallback, ['PHPIPAM_SERVER_URL'])),
61-
app_id=dict(required=True, fallback=(env_fallback, ['PHPIPAM_APP_ID'])),
61+
app_id=dict(required=False, fallback=(env_fallback, ['PHPIPAM_APP_ID']), default='ansible'),
6262
username=dict(required=True, fallback=(env_fallback, ['PHPIPAM_USERNAME'])),
6363
password=dict(required=True, fallback=(env_fallback, ['PHPIPAM_PASSWORD']), no_log=True),
6464
validate_certs=dict(type='bool', fallback=(env_fallback, ['PHPIPAM_VALIDATE_CERTS']), required=False, default=True),

plugins/modules/section.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def main():
122122
phpipam_spec=dict(
123123
name=dict(type='str', required=True),
124124
description=dict(type='str', required=False),
125-
parent=dict(type='entity', controller='sections', required=False, defautl=None, phpipam_name='masterSection'),
125+
parent=dict(type='entity', controller='sections', required=False, default=None, phpipam_name='masterSection'),
126126
permissions=dict(type='json', required=False, default=None),
127127
strict_mode=dict(type='bool', required=False),
128128
subnet_ordering=dict(type='bool', required=False, phpipam_name='subnetOrdering'),

tests/test_playbooks/shared_vars.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
- name: Check app_id defaults to 'ansible'
2+
hosts: localhost
3+
gather_facts: false
4+
vars_files:
5+
- vars/server.yml
6+
- vars/section.yml
7+
tasks:
8+
- name: Create section
9+
ansible.builtin.include_tasks: tasks/shared_vars_section.yml
10+
vars:
11+
step: create section
12+
section: '{{ base_section_data }}'
13+
- name: Delete section
14+
ansible.builtin.include_tasks: tasks/shared_vars_section.yml
15+
vars:
16+
step: delete section
17+
override:
18+
state: absent
19+
section: '{{ base_section_data | combine(override) }}'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
- name: "Ensure state of section: {{ step }}"
3+
codeaffen.phpipam.section:
4+
server_url: "{{ phpipam_server_url }}"
5+
username: "{{ phpipam_username }}"
6+
password: "{{ phpipam_password }}"
7+
name: "{{ section.name }}"
8+
description: "{{ section.description | default(omit) }}"
9+
parent: "{{ section.parent | default(omit) }}"
10+
permissions: "{{ section.permissions | default(omit) }}"
11+
strict_mode: "{{ section.strict_mode | default(omit) }}"
12+
subnet_ordering: "{{ section.subnet_ordering | default(omit) }}"
13+
list_order: "{{ section.list_order | default(omit) }}"
14+
show_vlan: "{{ section.show_vlan | default(omit) }}"
15+
show_vrf: "{{ section.show_vrf | default(omit) }}"
16+
show_supernets_only: "{{ section.show_supernets_only | default(omit) }}"
17+
dns_resolver: "{{ section.dns_resolver | default(omit) }}"
18+
validate_certs: "{{ section.validate_certs | default('no') }}"
19+
state: "{{ section.state | default('present') }}"

0 commit comments

Comments
 (0)