codeaffen.phpipam.subnet – Manage subnets

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.subnet.

New in version 0.0.1: of codeaffen.phpipam

Synopsis

  • create, update and delete subnets

Requirements

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

  • inflection
  • ipaddress
  • phpypam>=1.0.0

Parameters

Parameter Choices/Defaults Comments
allow_requests
boolean
    Choices:
  • no ←
  • yes
Controls if IP requests are allowed for subnet
app_id
string
Default:
"ansible"
API app name
cidr
string
Network in CIDR format.
Mutually exclusive with subnet and mask.
description
string
Text which is shown in side bar if 'show as name' is selected
discover_subnet
boolean
    Choices:
  • no ←
  • yes
Controls if new hosts should be discovered for new host scans
dns_records
boolean
    Choices:
  • no ←
  • yes
Controls weather hostname DNS records are displayed
dns_recursive
boolean
    Choices:
  • no ←
  • yes
Controls if PTR records should be created for subnet
is_folder
boolean
    Choices:
  • no ←
  • yes
Controls if we are adding subnet or folder
can't be changed after subnet was created
is_full
boolean
    Choices:
  • no ←
  • yes
Marks subnet as used
linked_subnet
string
Linked ipv6 subnet in CIDR format
location
string
Subnet location
mask
string
Prefix length (bits) for ipv4 and ipv6 subnets.
Mutually exclusive with cidr.
If set. subnet is required.
nameserver
string
Name of the DNS server which should attach to subnet
parent
string
CIDR of parent subnet

aliases: master_subnet_cidr
password
string / required
Password of the user to access phpIPAM server
permissions
json
Default:
"None"
JSON object that represent the permissions for each user
ping_subnet
boolean
    Choices:
  • no ←
  • yes
Controls if subnet should be included in status checks
scan_agent
string
Name of scanagent which should be used for subnet
section
integer / required
Name of the section under which the subnet is located
server_url
string / required
URL of the phpIPAM server
show_as_name
boolean
    Choices:
  • no ←
  • yes
If this is set to 'true' description is show in side bar instead of cidr
state
string
    Choices:
  • present ←
  • absent
State of the entity
subnet
string
Network address
Mutually exclusive with cidr.
If set, mask is required.
subnet_state
string
Assigned tag of the subnet.
threshold
integer
Subnet threshold
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.
vlan
string
VLAN which the subnet should belongs to
vrf
string
VRF which the sunet should belongs to

Examples

- name: "Create a subnet"
  codeaffen.phpipam.subnet:
    username: "admin"
    password: "s3cr3t"
    server_url: "https://ipam.example.com"
    cidr: "192.0.2.128/26"
    section: "EXAMPLE INC"
    state: present

- name: "Create a subnet with parent"
  codeaffen.phpipam.subnet:
    username: "admin"
    password: "s3cr3t"
    server_url: "https://ipam.example.com"
    cidr: "192.0.2.128/28"
    parent: "192.0.2.128/25"
    section: "DEVOPS department"
    state: present

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
entity
dictionary
success
Final state of the affected entities grouped by their type.

 
subnets
list / elements=dictionary
success
List of subnets.



Authors

  • Christian Meißner (@cmeissner)