netbox_community.ansible_modules.netbox_platform (0.1.10) — module

Create or delete platforms within Netbox

| "added in version" 0.1.0 of netbox_community.ansible_modules"

Authors: Mikhail Yohman (@FragmentedPacket)

preview | supported by community

Install collection

Install with ansible-galaxy collection install netbox_community.ansible_modules:==0.1.10


Add to requirements.yml

  collections:
    - name: netbox_community.ansible_modules
      version: 0.1.10

Description

Creates or removes platforms 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 platform within Netbox with only required information
      netbox_platform:
        netbox_url: http://netbox.local
        netbox_token: thisIsMyToken
        data:
          name: Test Platform
        state: present

    - name: Create platform within Netbox with only required information
      netbox_platform:
        netbox_url: http://netbox.local
        netbox_token: thisIsMyToken
        data:
          name: Test Platform All
          manufacturer: Test Manufacturer
          napalm_driver: ios
          napalm_args:
            global_delay_factor: 2
        state: present

    - name: Delete platform within netbox
      netbox_platform:
        netbox_url: http://netbox.local
        netbox_token: thisIsMyToken
        data:
          name: Test Platform
        state: absent

Inputs

    
data:
    description:
    - Defines the platform configuration
    suboptions:
      manufacturer:
        description:
        - The manufacturer the platform will be tied to
      name:
        description:
        - The name of the platform
        required: true
      napalm_args:
        description:
        - The optional arguments used for NAPALM connections
        type: dict
      napalm_driver:
        description:
        - The name of the NAPALM driver to be used when using the NAPALM plugin

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

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