aos_logical_device – Manage AOS Logical Device — Ansible Documentation

- AnsibleFest
- Products
- Community
- Webinars & Training
- Blog

Documentation

# aos_logical_device – Manage AOS Logical Device

New in version 2.3.

- DEPRECATED
- Synopsis
- Requirements
- Parameters
- Examples
- Status

## DEPRECATED

Removed in Ansible:
| version: 2.9
Why: | This module does not support AOS 2.1 or later
Alternative: | See new modules at https://www.ansible.com/ansible-apstra.

## Synopsis

- Apstra AOS Logical Device module let you manage your Logical Devices easily. You can create create and delete Logical Device by Name, ID or by using a JSON File. This module is idempotent and support the check mode. It’s using the AOS REST API.

## Requirements

The below requirements are needed on the host that executes this module.

- aos-pyez >= 0.6.0

## Parameters

Parameter | Choices/Defaults | Comments
--- | --- | ---
content - |  | Datastructure of the Logical Device to create. The data can be in YAML / JSON or directly a variable. It's the same datastructure that is returned on success in value.
id - |  | AOS Id of the Logical Device to manage (can't be used to create a new Logical Device), Only one of name, id or content can be set.
name - |  | Name of the Logical Device to manage. Only one of name, id or content can be set.
session - / required |  | An existing AOS session as obtained by aos_login module.
state - | Choices: present ← absent | Indicate what is the expected state of the Logical Device (present or not).

## Examples

    - name: "Delete a Logical Device by name"
      aos_logical_device:
        session: "{{ aos_session }}"
        name: "my-logical-device"
        state: absent

    - name: "Delete a Logical Device by id"
      aos_logical_device:
        session: "{{ aos_session }}"
        id: "45ab26fc-c2ed-4307-b330-0870488fa13e"
        state: absent

    # Save a Logical Device to a file

    - name: "Access Logical Device 1/3"
      aos_logical_device:
        session: "{{ aos_session }}"
        name: "my-logical-device"
        state: present
      register: logical_device

    - name: "Save Logical Device into a JSON file 2/3"
      copy:
        content: "{{ logical_device.value | to_nice_json }}"
        dest: logical_device_saved.json
    - name: "Save Logical Device into a YAML file 3/3"
      copy:
        content: "{{ logical_device.value | to_nice_yaml }}"
        dest: logical_device_saved.yaml

    - name: "Load Logical Device from a JSON file"
      aos_logical_device:
        session: "{{ aos_session }}"
        content: "{{ lookup('file', 'resources/logical_device_saved.json') }}"
        state: present

    - name: "Load Logical Device from a YAML file"
      aos_logical_device:
        session: "{{ aos_session }}"
        content: "{{ lookup('file', 'resources/logical_device_saved.yaml') }}"
        state: present

## Status

- This module will be removed in version 2.9. [deprecated]
- For more information see DEPRECATED.

### Authors

- Damien Garros (@dgarros)

Hint

If you notice any issues in this documentation you can edit this document to improve it.