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

Manage AOS ASN Pool

| "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 ASN Pool module let you manage your ASN Pool easily. You can create and delete ASN Pool 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 ASN Pool"
  aos_asn_pool:
    session: "{{ aos_session }}"
    name: "my-asn-pool"
    ranges:
      - [ 100, 200 ]
    state: present
  register: asnpool
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: "Save ASN Pool into a file in JSON"
  copy:
    content: "{{ asnpool.value | to_nice_json }}"
    dest: resources/asn_pool_saved.json
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: "Save ASN Pool into a file in YAML"
  copy:
    content: "{{ asnpool.value | to_nice_yaml }}"
    dest: resources/asn_pool_saved.yaml
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.

- name: "Delete ASN Pool"
  aos_asn_pool:
    session: "{{ aos_session }}"
    name: "my-asn-pool"
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: "Load ASN Pool from File(JSON)"
  aos_asn_pool:
    session: "{{ aos_session }}"
    content: "{{ lookup('file', 'resources/asn_pool_saved.json') }}"
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: "Delete ASN Pool from File(JSON)"
  aos_asn_pool:
    session: "{{ aos_session }}"
    content: "{{ lookup('file', 'resources/asn_pool_saved.json') }}"
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: "Load ASN Pool from File(Yaml)"
  aos_asn_pool:
    session: "{{ aos_session }}"
    content: "{{ lookup('file', 'resources/asn_pool_saved.yaml') }}"
    state: present
  register: test
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: "Delete ASN Pool from File(Yaml)"
  aos_asn_pool:
    session: "{{ aos_session }}"
    content: "{{ lookup('file', 'resources/asn_pool_saved.yaml') }}"
    state: absent

Inputs

    
id:
    description:
    - AOS Id of the ASN Pool to manage. Only one of I(name), I(id) or I(content) can be
      set.

name:
    description:
    - Name of the ASN Pool 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 ASN Pool (present or not).

ranges:
    description:
    - List of ASNs ranges to add to the ASN Pool. Each range must have 2 values.

content:
    description:
    - Datastructure of the ASN Pool to manage. The data can be in YAML / JSON or directly
      a variable. 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