codeaffen.phpipam.location – Manage locations

Note

This plugin is part of the codeaffen.phpipam collection (version 1.5.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install codeaffen.phpipam.

To use it in a playbook, specify: codeaffen.phpipam.location.

New in version 1.4.0: of codeaffen.phpipam

Synopsis

  • create, update and delete locations

Requirements

The below requirements are needed on the host that executes this module.

  • geopy

  • inflection

  • ipaddress

  • phpypam>=1.0.0

Parameters

Parameter Choices/Defaults Comments
address
string
Address of the given location
if resolv_location is set to True, this address will be used to resolve the latitude and longitude
Mutually exclusive with latitude and longitude
app_id
string
Default:
"ansible"
API app name
description
string
Description of the given location
latitude
float
Latitude of the given location
if resolv_location is set to True, this latitude will be used to resolve the address
This parameter is mutually exclusive with address
This parameter is required if longitude is given
longitude
float
Longitude of the given location
if resolv_location is set to True, this longitude will be used to resolve the address
This parameter is mutually exclusive with address
This parameter is required if latitude is given
name
string / required
Name of the given location
password
string / required
Password of the user to access phpIPAM server
resolv_location
boolean
    Choices:
  • no ←
  • yes
Resolve the given location
Requires network connectivity to https://nominatim.org/ to resolve the given address
If address can not be resolved, latitude and longitude will not be set
server_url
string / required
URL of the phpIPAM server
state
string
    Choices:
  • present ←
  • absent
State of the entity
username
string / required
Username to access phpIPAM server
validate_certs
boolean
    Choices:
  • no
  • yes ←
Is the TLS certificate of the phpIPAM server verified or not.

Examples

- name: "Create with address"
  codeaffen.phpipam.location:
    username: "admin"
    password: "s3cr3t"
    server_url: "https://ipam.example.com"
    name: "my location"
    description: "my location description"
    address: "my location address"
    state: present

- name: "Create location with geo coordinates"
  codeaffen.phpipam.location:
    username: "admin"
    password: "s3cr3t"
    server_url: "https://ipam.example.com"
    name: "my location"
    description: "my location description"
    latitude: 123.456
    longitude: 123.456
    state: present

- name: "Remove location"
  codeaffen.phpipam.location:
    username: "admin"
    password: "s3cr3t"
    server_url: "https://ipam.example.com"
    name: "my location"
    state: absent

Authors

  • Christian Meißner (@cmeissner)