codeaffen.phpipam.device module – Manage devices

Note

This module is part of the codeaffen.phpipam collection (version 1.7.0).

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. You need further requirements to be able to use this module, see Requirements for details.

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

New in codeaffen.phpipam 0.5.0

Synopsis

  • create, update and delete devices

Requirements

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

  • inflection

  • ipaddress

  • phpypam>=1.0.0

Parameters

Parameter

Comments

app_id

string

API app name

Default: "ansible"

description

string

A descriptive text for that entity

hostname

string / required

Hostname of the given device

ipaddress

string

IP address of the given device

password

string / required

Password of the user to access phpIPAM server

rack

string

Rack where the device belongs to.

If set starting_rack_unit and rack_units are also required.

rack_units

integer

Size of device in U.

If set rack and starting_rack_unit are also required.

sections

list / elements=string

List of sections where the device belongs to

server_url

string / required

URL of the phpIPAM server

snmp_community

string

The SNMP community string

snmp_port

string

The used SNMP port

Default: "161"

snmp_queries

string

snmp_timeout

string

The SNMP connection timeout

snmp_v3_auth_pass

string

The password to authenticate via SNMPv3

snmp_v3_auth_protocol

string

The used SNMPv3 auth protocol

snmp_v3_ctx_engine_id

string

CTX engine id when using SNMPv3

snmp_v3_ctx_name

string

CTX name when using SNMPv3

snmp_v3_priv_pass

string

The password to authenticate via SNMPv3 in privacy mode

snmp_v3_priv_protocol

string

The used SNMPv3 privacy protocol

snmp_v3_sec_level

string

The used SNMPv3 security level

snmp_version

string

The used SNMP version

starting_rack_unit

string

Which is the starting rack unit where the device is mounted.

If set rack and racK_units are also required.

state

string

State of the entity

Choices:

  • "present" ← (default)

  • "absent"

type

string

Device type of this device.

The value has to reflect values from device types configured.

Default device types are Switch, Router, Firewall, Hub, Wireless, Database, Workstation, Laptop and Other.

User defined types can be created either via UI, API (e.g. device_type ansible module within this collection).

username

string / required

Username to access phpIPAM server

validate_certs

boolean

Is the TLS certificate of the phpIPAM server verified or not.

Choices:

  • false

  • true ← (default)

Examples

- 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"
    sections:
      - Example Inc.
      - DEVOPS department
    state: present

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

Authors

  • Christian Meißner (@cmeissner)