ansible.builtin.aos_external_router (v2.4.6.0-1) — module

Manage AOS External Router

| "added in version" 2.3 of ansible.builtin"

Authors: Damien Garros (@dgarros)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.4.6.0.post1

Description

Apstra AOS External Router module let you manage your External Router easily. You can create create and delete External Router by Name, ID or by using a JSON File. This module is idempotent and support the I(check) mode. It's using the AOS REST API.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.

- name: "Create an External Router"
  aos_external_router:
    session: "{{ aos_session }}"
    name: "my-external-router"
    loopback: 10.0.0.1
    asn: 65000
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: "Check if an External Router exist by ID"
  aos_external_router:
    session: "{{ aos_session }}"
    name: "45ab26fc-c2ed-4307-b330-0870488fa13e"
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: "Delete an External Router by name"
  aos_external_router:
    session: "{{ aos_session }}"
    name: "my-external-router"
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: "Delete an External Router by id"
  aos_external_router:
    session: "{{ aos_session }}"
    id: "45ab26fc-c2ed-4307-b330-0870488fa13e"
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Save an External Router to a file
- name: "Access External Router 1/3"
  aos_external_router:
    session: "{{ aos_session }}"
    name: "my-external-router"
    state: present
  register: external_router
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: "Save External Router into a file in JSON 2/3"
  copy:
    content: "{{ external_router.value | to_nice_json }}"
    dest: external_router_saved.json
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: "Save External Router into a file in YAML 3/3"
  copy:
    content: "{{ external_router.value | to_nice_yaml }}"
    dest: external_router_saved.yaml
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: "Load External Router from a JSON file"
  aos_external_router:
    session: "{{ aos_session }}"
    content: "{{ lookup('file', 'resources/external_router_saved.json') }}"
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: "Load External Router from a YAML file"
  aos_external_router:
    session: "{{ aos_session }}"
    content: "{{ lookup('file', 'resources/external_router_saved.yaml') }}"
    state: present

Inputs

    
id:
    description:
    - AOS Id of the External Router to manage (can't be used to create a new External
      Router), Only one of I(name), I(id) or I(content) can be set.

asn:
    description:
    - ASN id of the external_router.

name:
    description:
    - Name of the External Router to manage. Only one of I(name), I(id) or I(content)
      can be set.

state:
    choices:
    - present
    - absent
    default: present
    description:
    - Indicate what is the expected state of the External Router (present or not).

content:
    description:
    - Datastructure of the External Router to create. The format is defined by the I(content_format)
      parameter. It's the same datastructure that is returned on success in I(value).

session:
    description:
    - An existing AOS session as obtained by M(aos_login) module.
    required: true

loopback:
    description:
    - IP address of the Loopback interface of the external_router.