Skip to content

Specifying a tag for an address fails with phpypam.core.exceptions.PHPyPAMInvalidSyntax: Invalid filter_by error #57

@scottatron

Description

@scottatron

Describe the bug

When specifying a tag for a codeaffen.phpipam.address, the task fails with the error phpypam.core.exceptions.PHPyPAMInvalidSyntax: Invalid filter_by

To Reproduce
Steps to reproduce the behavior:

Define a task that looks something like the task below—with a tag specified as a string value.

  - codeaffen.phpipam.address:
      username: my_phpipam_username
      password: my_phpipam_password
      server_url: https://myphpiamserver.local
      app_id: my_phpipam_app
      section: my_subnet_section
      ipaddress: 10.20.0.1
      tag: Reserved
      subnet: 10.20.0.0/24

Expected behavior

I expect the address to be added to phpIPAM and the tag to have been resolved correctly.

Versions:

  • Ansible: core 2.11.6
  • phpipam-ansible-modules: 1.3.1
  • phpypam: 1.0.2

Additional context

This appears to be because the responses from the tools/tags endpoint does not include a tag attribute, but rather the tag string is returned in a type attribute. This does not follow the convention that is expected by default in PhpipamAnsibleModule.find_by_key

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions