networktocode.nautobot.site (4.5.0) — module

Creates or removes sites from Nautobot

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

Authors: Mikhail Yohman (@FragmentedPacket)

Install collection

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


Add to requirements.yml

  collections:
    - name: networktocode.nautobot
      version: 4.5.0

Description

Creates or removes sites from Nautobot


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: "Test Nautobot site module"
  connection: local
  hosts: localhost
  gather_facts: False
  tasks:
    - name: Create site within Nautobot with only required information
      networktocode.nautobot.site:
        url: http://nautobot.local
        token: thisIsMyToken
        name: Test - Colorado
        status: active
        state: present

    - name: Delete site within nautobot
      networktocode.nautobot.site:
        url: http://nautobot.local
        token: thisIsMyToken
        name: Test - Colorado
        state: absent

    - name: Create site with all parameters
      networktocode.nautobot.site:
        url: http://nautobot.local
        token: thisIsMyToken
        name: Test - California
        status: Planned
        region: Test Region
        tenant: Test Tenant
        facility: EquinoxCA7
        asn: 65001
        time_zone: America/Los Angeles
        description: This is a test description
        physical_address: Hollywood, CA, 90210
        shipping_address: Hollywood, CA, 90210
        latitude: 10.100000
        longitude: 12.200000
        contact_name: Jenny
        contact_phone: 867-5309
        contact_email: jenny@changednumber.com
        slug: test-california
        comments: ### Placeholder
        state: present

Inputs

    
asn:
    description:
    - The ASN associated with the site
    required: false
    type: int
    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

name:
    description:
    - Name of the site to be created
    required: true
    type: str

slug:
    description:
    - URL-friendly unique shorthand
    required: false
    type: str
    version_added: 3.0.0
    version_added_collection: networktocode.nautobot

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

region:
    description:
    - The region that the site should be associated with
    required: false
    type: raw
    version_added: 3.0.0
    version_added_collection: networktocode.nautobot

status:
    description:
    - Status of the site
    - 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 the site will be assigned to
    required: false
    type: raw
    version_added: 3.0.0
    version_added_collection: networktocode.nautobot

comments:
    description:
    - Comments for the site. This can be markdown syntax
    required: false
    type: str
    version_added: 3.0.0
    version_added_collection: networktocode.nautobot

facility:
    description:
    - Data center provider or facility, ex. Equinix NY7
    required: false
    type: str
    version_added: 3.0.0
    version_added_collection: networktocode.nautobot

latitude:
    description:
    - Latitude in decimal format
    required: false
    type: str
    version_added: 3.0.0
    version_added_collection: networktocode.nautobot

longitude:
    description:
    - Longitude in decimal format
    required: false
    type: str
    version_added: 3.0.0
    version_added_collection: networktocode.nautobot

time_zone:
    description:
    - Timezone associated with the site, ex. America/Denver
    required: false
    type: str
    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

description:
    description:
    - The description of the prefix
    required: false
    type: str
    version_added: 3.0.0
    version_added_collection: networktocode.nautobot

contact_name:
    description:
    - Name of contact for site
    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

contact_email:
    description:
    - Contact email for site
    required: false
    type: str
    version_added: 3.0.0
    version_added_collection: networktocode.nautobot

contact_phone:
    description:
    - Contact phone number for site
    required: false
    type: str
    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

physical_address:
    description:
    - Physical address of site
    required: false
    type: str
    version_added: 3.0.0
    version_added_collection: networktocode.nautobot

shipping_address:
    description:
    - Shipping address of site
    required: false
    type: str
    version_added: 3.0.0
    version_added_collection: networktocode.nautobot

Outputs

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