networktocode.nautobot.circuit (5.1.1) — module

Create, update or delete circuits within Nautobot

| "added in version" 1.0.0 of networktocode.nautobot"

Authors: Mikhail Yohman (@FragmentedPacket)

Install collection

Install with ansible-galaxy collection install networktocode.nautobot:==5.1.1


Add to requirements.yml

  collections:
    - name: networktocode.nautobot
      version: 5.1.1

Description

Creates, updates or removes circuits from Nautobot


Requirements

Usage examples

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

  tasks:
    - name: Create circuit within Nautobot with only required information
      networktocode.nautobot.circuit:
        url: http://nautobot.local
        token: thisIsMyToken
        cid: Test Circuit
        provider: Test Provider
        circuit_type: Test Circuit Type
        status: active
        state: present

    - name: Update circuit with other fields
      networktocode.nautobot.circuit:
        url: http://nautobot.local
        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 nautobot
      networktocode.nautobot.circuit:
        url: http://nautobot.local
        token: thisIsMyToken
        cid: Test-Circuit-1000
        state: absent

Inputs

    
cid:
    description:
    - The circuit id of the circuit
    required: true
    type: str
    version_added: 3.0.0
    version_added_collection: networktocode.nautobot

url:
    description:
    - 'The URL of the Nautobot instance resolvable by the Ansible host (for example: http://nautobot.example.com:8000)'
    required: true
    type: str

tags:
    description:
    - Any tags that this item may need to be associated with
    elements: raw
    required: false
    type: list
    version_added: 3.0.0
    version_added_collection: networktocode.nautobot

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

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

status:
    description:
    - The status of the circuit
    - Required if I(state=present) and does not exist yet
    required: false
    type: raw
    version_added: 3.0.0
    version_added_collection: networktocode.nautobot

tenant:
    description:
    - The tenant assigned to the circuit
    required: false
    type: raw
    version_added: 3.0.0
    version_added_collection: networktocode.nautobot

comments:
    description:
    - Comments related to circuit
    required: false
    type: str
    version_added: 3.0.0
    version_added_collection: networktocode.nautobot

provider:
    description:
    - The provider of the circuit
    required: false
    type: raw
    version_added: 3.0.0
    version_added_collection: networktocode.nautobot

api_version:
    description:
    - API Version Nautobot REST API
    required: false
    type: str
    version_added: 4.1.0
    version_added_collection: networktocode.nautobot

commit_rate:
    description:
    - Commit rate of the circuit (Kbps)
    required: false
    type: int
    version_added: 3.0.0
    version_added_collection: networktocode.nautobot

description:
    description:
    - Description of the circuit
    required: false
    type: str
    version_added: 3.0.0
    version_added_collection: networktocode.nautobot

circuit_type:
    description:
    - The circuit type of the circuit
    required: false
    type: raw
    version_added: 3.0.0
    version_added_collection: networktocode.nautobot

install_date:
    description:
    - The date the circuit was installed. e.g. YYYY-MM-DD
    required: false
    type: str
    version_added: 3.0.0
    version_added_collection: networktocode.nautobot

query_params:
    description:
    - This can be used to override the specified values in ALLOWED_QUERY_PARAMS that is
      defined
    - in plugins/module_utils/utils.py and provides control to users on what may make
    - an object unique in their environment.
    elements: str
    required: false
    type: list
    version_added: 3.0.0
    version_added_collection: networktocode.nautobot

custom_fields:
    description:
    - Must exist in Nautobot and in key/value format
    required: false
    type: dict
    version_added: 3.0.0
    version_added_collection: networktocode.nautobot

validate_certs:
    default: true
    description:
    - If C(no), SSL certificates will not be validated. This should only be used on personally
      controlled sites using self-signed certificates.
    required: false
    type: raw

Outputs

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