codeaffen.phpipam.device – Manage devices

Note

This plugin is part of the codeaffen.phpipam collection.

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

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

New in version 0.5.0: of codeaffen.phpipam

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 Choices/Defaults Comments
app_id
string
Default:
"ansible"
API app name
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 nameserver appears
server_url
string / required
URL of the phpIPAM server
snmp_community
string
The SNMP community string
snmp_port
string
Default:
161
The used SNMP port
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
    Choices:
  • present ←
  • absent
State of the entity
type
string
Device type of this device.
The value have 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 eigther via UI, API (e.g. device_type ansible module within this collection).
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 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)