codeaffen / phpipam-ansible-modules

Ansible Modules to manage phpIPAM installations
https://codeaffen.org/projects/phpipam-ansible-modules
GNU General Public License v3.0
22 stars 10 forks source link

implement - location and custom_x field #119

Open urskog84 opened 1 week ago

urskog84 commented 1 week ago

almost every object in the phpIPAM database have the option to set a "location" that's correspond to the ID of the location.

would be nice to have that available int the modules.


# Example

- name: "Create device"
  codeaffen.phpipam.device:
    username: "admin"
    password: "s3cr3t"
    server_url: "https://ipam.example.com"
    hostname: "leaf-example-01"
    ipaddress: "192.0.2.222"
    location_id: 53          <--- New
    sections:
      - Example Inc.
      - DEVOPS department
    state: present

you can also have custom database fealds. the are all prefixed in the db with custom_xx

- name: "Create device"
  codeaffen.phpipam.device:
    username: "admin"
    password: "s3cr3t"
    server_url: "https://ipam.example.com"
    hostname: "sta-print-11"
    ipaddress: "192.1.2.22"
    custom:
        - serailnumber: "75290011489ZC"

    state: present

when it you send to the api

{
    "id": "1660",
    "hostname": "sta-print-11",
    "ip": "192.1.2.22",
    "custom_serialnumber": "75290011489ZC",
  }
cmeissner commented 1 week ago

@urskog84 thank you for bringing this to our attention.

Please rephrase your feature request to only requesting one feature.

The first requested feature of managing locations in entities has a good chance to be implemented.

The second feature was already requested in #118 and discarded. Please see this issue for details.

urskog84 commented 1 week ago

Wow. quick resone @cmeissner.