fragmentedpacket.netbox_modules.netbox_ipam_role (0.1.4) — module

Creates or removes ipam roles from Netbox

| "added in version" 0.1.0 of fragmentedpacket.netbox_modules"

Authors: Mikhail Yohman (@FragmentedPacket)

preview | supported by community

Install collection

Install with ansible-galaxy collection install fragmentedpacket.netbox_modules:==0.1.4


Add to requirements.yml

  collections:
    - name: fragmentedpacket.netbox_modules
      version: 0.1.4

Description

Creates or removes ipam roles from Netbox


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: "Test Netbox module"
  connection: local
  hosts: localhost
  gather_facts: False
  tasks:
    - name: Create ipam role within Netbox with only required information
      netbox_ipam_role:
        netbox_url: http://netbox.local
        netbox_token: thisIsMyToken
        data:
          name: Test IPAM Role 
        state: present

    - name: Delete ipam role within netbox
      netbox_ipam_role:
        netbox_url: http://netbox.local
        netbox_token: thisIsMyToken
        data:
          name: Test IPAM Role
        state: absent

Inputs

    
data:
    description:
    - Defines the ipam role configuration
    required: true
    suboptions:
      name:
        description:
        - Name of the ipam role to be created
        required: true
        type: str
      weight:
        description:
        - The weight of the ipam role to be created
        type: int
    type: dict

state:
    choices:
    - absent
    - present
    default: present
    description:
    - Use C(present) or C(absent) for adding or removing.
    type: str

netbox_url:
    description:
    - URL of the Netbox instance resolvable by Ansible control host
    required: true
    type: str

netbox_token:
    description:
    - The token created within Netbox to authorize API access
    required: true
    type: str

validate_certs:
    default: 'yes'
    description:
    - 'If C(no), SSL certificates will not be validated.

      This should only be used on personally controlled sites using self-signed certificates.

      '
    type: bool

Outputs

msg:
  description: Message indicating failure or info about what has been achieved
  returned: always
  type: str
role:
  description: Serialized object as created or already existent within Netbox
  returned: on creation
  type: dict