fragmentedpacket.netbox_modules.netbox_circuit (0.1.4) — module

Create, update or delete circuits within 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, updates or removes circuits from Netbox


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: "Test Netbox modules"
  connection: local
  hosts: localhost
  gather_facts: False

  tasks:
    - name: Create circuit within Netbox with only required information
      netbox_circuit:
        netbox_url: http://netbox.local
        netbox_token: thisIsMyToken
        data:
          cid: Test Circuit
          provider: Test Provider
          circuit_type: Test Circuit Type
        state: present

    - name: Update circuit with other fields
      netbox_circuit:
        netbox_url: http://netbox.local
        netbox_token: thisIsMyToken
        data:
          cid: Test-Circuit-1000
          provider: Test Provider
          circuit_type: Test Circuit Type
          status: Active
          tenant: Test Tenant
          install_date: "2018-12-25"
          commit_rate: 10000
          description: Test circuit
          comments: "FAST CIRCUIT"
        state: present

    - name: Delete circuit within netbox
      netbox_circuit:
        netbox_url: http://netbox.local
        netbox_token: thisIsMyToken
        data:
          cid: Test-Circuit-1000
        state: absent

Inputs

    
data:
    description:
    - Defines the circuit configuration
    suboptions:
      cid:
        description:
        - The circuit id of the circuit
        required: true
      circuit_type:
        description:
        - The circuit type of the circuit
      comments:
        description:
        - Comments related to circuit
      commit_rate:
        description:
        - Commit rate of the circuit (Kbps)
      custom_fields:
        description:
        - must exist in Netbox
      description:
        description:
        - Description of the circuit
      install_date:
        description:
        - The date the circuit was installed. e.g. YYYY-MM-DD
      provider:
        description:
        - The provider of the circuit
        required: true
      status:
        choices:
        - Active
        - Offline
        - Planned
        - Provisioning
        - Deprovisioning
        - Decommissioned
        description:
        - The status of the circuit
      tags:
        description:
        - Any tags that the device may need to be associated with
      tenant:
        description:
        - The tenant assigned to the circuit

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

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

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

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

circuit:
  description: Serialized object as created or already existent within Netbox
  returned: success (when I(state=present))
  type: dict
msg:
  description: Message indicating failure or info about what has been achieved
  returned: always
  type: str