networktocode / networktocode.nautobot / 4.5.0 / module / route_target Creates or removes route targets from Nautobot | "added in version" 1.0.0 of networktocode.nautobot" Authors: Mikhail Yohman (@FragmentedPacket)networktocode.nautobot.route_target (4.5.0) — module
Install with ansible-galaxy collection install networktocode.nautobot:==4.5.0
collections: - name: networktocode.nautobot version: 4.5.0
Creates or removes route targets from Nautobot
- name: "Test route target creation/deletion" connection: local hosts: localhost gather_facts: False tasks: - name: Create Route Targets networktocode.nautobot.route_target: url: http://nautobot.local token: thisIsMyToken name: "{{ item.name }}" tenant: "Test Tenant" tags: - Schnozzberry loop: - { name: "65000:65001", description: "management" } - { name: "65000:65002", description: "tunnel" } - name: Update Description on Route Targets networktocode.nautobot.route_target: url: http://nautobot.local token: thisIsMyToken name: "{{ item.name }}" tenant: "Test Tenant" description: "{{ item.description }}" tags: - Schnozzberry loop: - { name: "65000:65001", description: "management" } - { name: "65000:65002", description: "tunnel" } - name: Delete Route Targets networktocode.nautobot.route_target: url: http://nautobot.local token: thisIsMyToken name: "{{ item }}" state: absent loop: - "65000:65001" - "65000:65002"
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: - Route target name 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 tenant: description: - The tenant that the route target will be assigned to 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 description: description: - Tag description 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
msg: description: Message indicating failure or info about what has been achieved returned: always type: str route_target: description: Serialized object as created/existent/updated/deleted within Nautobot returned: always type: dict