codeaffen.phpipam.subnet (1.7.0) — module

Manage subnets

| "added in version" 0.0.1 of codeaffen.phpipam"

Authors: Christian Meißner (@cmeissner)

Install collection

Install with ansible-galaxy collection install codeaffen.phpipam:==1.7.0


Add to requirements.yml

  collections:
    - name: codeaffen.phpipam
      version: 1.7.0

Description

create, update and delete subnets


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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

Inputs

    
vrf:
    description: VRF which the sunet should belongs to
    required: false
    type: str

cidr:
    description:
    - Network in CIDR format.
    - Mutually exclusive with I(subnet) and I(mask).
    required: false
    type: str

mask:
    description:
    - Prefix length (bits) for ipv4 and ipv6 subnets.
    - Mutually exclusive with I(cidr).
    - If set. I(subnet) is required.

vlan:
    description: VLAN which the subnet should belongs to
    required: false
    type: str

state:
    choices:
    - present
    - absent
    default: present
    description: State of the entity
    type: str

app_id:
    default: ansible
    description: API app name
    required: false
    type: str

folder:
    description: folder name which subnet belongs to
    required: false
    type: str

parent:
    aliases:
    - master_subnet_cidr
    description: CIDR of parent subnet
    required: false
    type: str

subnet:
    description:
    - Network address
    - Mutually exclusive with I(cidr).
    - If set, I(mask) is required.
    required: false
    type: str

is_full:
    default: false
    description: Marks subnet as used
    required: false
    type: bool

section:
    description: Name of the section under which the subnet is located
    required: true
    type: int

location:
    description: Subnet location
    required: false
    type: str

password:
    description: Password of the user to access phpIPAM server
    required: true
    type: str

username:
    description: Username to access phpIPAM server
    required: true
    type: str

threshold:
    description: Subnet threshold
    required: false
    type: int

nameserver:
    description: Name of the DNS server which should attach to subnet
    required: false
    type: str

scan_agent:
    description: Name of scanagent which should be used for subnet
    required: false
    type: string

server_url:
    description: URL of the phpIPAM server
    required: true
    type: str

description:
    description: Text which is shown in side bar if 'show as name' is selected
    required: false
    type: str

dns_records:
    default: false
    description: Controls whether hostname DNS records are displayed
    required: false
    type: bool

permissions:
    default: None
    description: JSON object that represent the permissions for each user
    required: false
    type: json

ping_subnet:
    default: false
    description: Controls if subnet should be included in status checks
    required: false
    type: bool

show_as_name:
    default: false
    description: If this is set to 'true' description is shown in side bar instead of
      CIDR
    required: false
    type: bool

subnet_state:
    description: Assigned tag of the subnet.
    required: false
    type: string

dns_recursive:
    default: false
    description: Controls if PTR records should be created for subnet
    required: false
    type: bool

linked_subnet:
    description: Linked ipv6 subnet in CIDR format
    required: false
    type: str

allow_requests:
    default: false
    description: Controls if IP requests are allowed for subnet
    required: false
    type: bool

routing_domain:
    default: default
    description:
    - Layer-2 routing domain the vlan belongs to
    - If you have I(vlan) with same number in different routing domains it need to be
      set on desired value
    required: false
    type: str
    version_added: 1.6.0
    version_added_collection: codeaffen.phpipam

validate_certs:
    default: true
    description: Is the TLS certificate of the phpIPAM server verified or not.
    required: false
    type: bool

discover_subnet:
    default: false
    description: Controls if new hosts should be discovered for new host scans
    required: false
    type: bool

Outputs

entity:
  contains:
    subnets:
      description: List of subnets.
      elements: dict
      type: list
  description: Final state of the affected entities grouped by their type.
  returned: success
  type: dict