Skip to content

Latest commit

 

History

History
1391 lines (717 loc) · 28.4 KB

subnet_module.rst

File metadata and controls

1391 lines (717 loc) · 28.4 KB
orphan:

codeaffen.phpipam.subnet module -- Manage subnets

Note

This module is part of the codeaffen.phpipam collection (version 1.7.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.subnet.

.. versionadded:: 0.0.1 of codeaffen.phpipam

  • create, update and delete subnets

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

  • inflection
  • ipaddress
  • phpypam>=1.0.0
.. rst-class:: ansible-option-table

Parameter Comments
.. rst-class:: ansible-option-title

allow_requests

.. rst-class:: ansible-option-type-line

boolean

Controls if IP requests are allowed for subnet

.. rst-class:: ansible-option-line

Choices:

  • no ← (default)
  • yes
.. rst-class:: ansible-option-title

app_id

.. rst-class:: ansible-option-type-line

string

API app name

.. rst-class:: ansible-option-line

Default: "ansible"

.. rst-class:: ansible-option-title

cidr

.. rst-class:: ansible-option-type-line

string

Network in CIDR format.

Mutually exclusive with subnet and mask.

.. rst-class:: ansible-option-title

description

.. rst-class:: ansible-option-type-line

string

Text which is shown in side bar if 'show as name' is selected

.. rst-class:: ansible-option-title

discover_subnet

.. rst-class:: ansible-option-type-line

boolean

Controls if new hosts should be discovered for new host scans

.. rst-class:: ansible-option-line

Choices:

  • no ← (default)
  • yes
.. rst-class:: ansible-option-title

dns_records

.. rst-class:: ansible-option-type-line

boolean

Controls whether hostname DNS records are displayed

.. rst-class:: ansible-option-line

Choices:

  • no ← (default)
  • yes
.. rst-class:: ansible-option-title

dns_recursive

.. rst-class:: ansible-option-type-line

boolean

Controls if PTR records should be created for subnet

.. rst-class:: ansible-option-line

Choices:

  • no ← (default)
  • yes
.. rst-class:: ansible-option-title

folder

.. rst-class:: ansible-option-type-line

string

folder name which subnet belongs to

.. rst-class:: ansible-option-title

is_full

.. rst-class:: ansible-option-type-line

boolean

Marks subnet as used

.. rst-class:: ansible-option-line

Choices:

  • no ← (default)
  • yes
.. rst-class:: ansible-option-title

linked_subnet

.. rst-class:: ansible-option-type-line

string

Linked ipv6 subnet in CIDR format

.. rst-class:: ansible-option-title

location

.. rst-class:: ansible-option-type-line

string

Subnet location

.. rst-class:: ansible-option-title

mask

.. rst-class:: ansible-option-type-line

string

Prefix length (bits) for ipv4 and ipv6 subnets.

Mutually exclusive with cidr.

If set. subnet is required.

.. rst-class:: ansible-option-title

nameserver

.. rst-class:: ansible-option-type-line

string

Name of the DNS server which should attach to subnet

.. rst-class:: ansible-option-title

parent

.. rst-class:: ansible-option-type-line

aliases: master_subnet_cidr

.. rst-class:: ansible-option-type-line

string

CIDR of parent subnet

.. rst-class:: ansible-option-title

password

.. rst-class:: ansible-option-type-line

string / required

Password of the user to access phpIPAM server

.. rst-class:: ansible-option-title

permissions

.. rst-class:: ansible-option-type-line

json

JSON object that represent the permissions for each user

.. rst-class:: ansible-option-line

Default: "None"

.. rst-class:: ansible-option-title

ping_subnet

.. rst-class:: ansible-option-type-line

boolean

Controls if subnet should be included in status checks

.. rst-class:: ansible-option-line

Choices:

  • no ← (default)
  • yes
.. rst-class:: ansible-option-title

routing_domain

.. rst-class:: ansible-option-type-line

string

added in 1.6.0 of codeaffen.phpipam

Layer-2 routing domain the vlan belongs to

If you have vlan with same number in different routing domains it need to be set on desired value

.. rst-class:: ansible-option-line

Default: "default"

.. rst-class:: ansible-option-title

scan_agent

.. rst-class:: ansible-option-type-line

string

Name of scanagent which should be used for subnet

.. rst-class:: ansible-option-title

section

.. rst-class:: ansible-option-type-line

integer / required

Name of the section under which the subnet is located

.. rst-class:: ansible-option-title

server_url

.. rst-class:: ansible-option-type-line

string / required

URL of the phpIPAM server

.. rst-class:: ansible-option-title

show_as_name

.. rst-class:: ansible-option-type-line

boolean

If this is set to 'true' description is shown in side bar instead of CIDR

.. rst-class:: ansible-option-line

Choices:

  • no ← (default)
  • yes
.. rst-class:: ansible-option-title

state

.. rst-class:: ansible-option-type-line

string

State of the entity

.. rst-class:: ansible-option-line

Choices:

  • present ← (default)
  • absent
.. rst-class:: ansible-option-title

subnet

.. rst-class:: ansible-option-type-line

string

Network address

Mutually exclusive with cidr.

If set, mask is required.

.. rst-class:: ansible-option-title

subnet_state

.. rst-class:: ansible-option-type-line

string

Assigned tag of the subnet.

.. rst-class:: ansible-option-title

threshold

.. rst-class:: ansible-option-type-line

integer

Subnet threshold

.. rst-class:: ansible-option-title

username

.. rst-class:: ansible-option-type-line

string / required

Username to access phpIPAM server

.. rst-class:: ansible-option-title

validate_certs

.. rst-class:: ansible-option-type-line

boolean

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

.. rst-class:: ansible-option-line

Choices:

  • no
  • yes ← (default)
.. rst-class:: ansible-option-title

vlan

.. rst-class:: ansible-option-type-line

string

VLAN which the subnet should belongs to

.. rst-class:: ansible-option-title

vrf

.. rst-class:: ansible-option-type-line

string

VRF which the sunet should belongs to

- 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

Common return values are documented :ref:`here <common_return_values>`, the following are the fields unique to this module:

.. rst-class:: ansible-option-table

Key Description
.. rst-class:: ansible-option-title

entity

.. rst-class:: ansible-option-type-line

dictionary

Final state of the affected entities grouped by their type.

.. rst-class:: ansible-option-line

Returned: success

.. rst-class:: ansible-option-title

subnets

.. rst-class:: ansible-option-type-line

list / elements=dictionary

List of subnets.

.. rst-class:: ansible-option-line

Returned: success

Authors

  • Christian Meißner (@cmeissner)

Collection links

Issue Tracker Homepage Repository (Sources)