aos_rack_type - Manage AOS Rack Type

New in version 2.3.

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 Rack Type module let you manage your Rack Type easily. You can create create and delete Rack Type 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 Rack Type 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 Rack Type to manage (can't be used to create a new Rack Type), Only one of name, id or content can be set.
name
Name of the Rack Type 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 Rack Type (present or not).

Examples

- name: "Delete a Rack Type by name"
  aos_rack_type:
    session: "{{ aos_session }}"
    name: "my-rack-type"
    state: absent

- name: "Delete a Rack Type by id"
  aos_rack_type:
    session: "{{ aos_session }}"
    id: "45ab26fc-c2ed-4307-b330-0870488fa13e"
    state: absent

# Save a Rack Type to a file

- name: "Access Rack Type 1/3"
  aos_rack_type:
    session: "{{ aos_session }}"
    name: "my-rack-type"
    state: present
  register: rack_type
- name: "Save Rack Type into a JSON file 2/3"
  copy:
    content: "{{ rack_type.value | to_nice_json }}"
    dest: rack_type_saved.json
- name: "Save Rack Type into a YAML file 3/3"
  copy:
    content: "{{ rack_type.value | to_nice_yaml }}"
    dest: rack_type_saved.yaml

- name: "Load Rack Type from a JSON file"
  aos_rack_type:
    session: "{{ aos_session }}"
    content: "{{ lookup('file', 'resources/rack_type_saved.json') }}"
    state: present

- name: "Load Rack Type from a YAML file"
  aos_rack_type:
    session: "{{ aos_session }}"
    content: "{{ lookup('file', 'resources/rack_type_saved.yaml') }}"
    state: present

Status

This module is flagged as deprecated and will be removed in version 2.9. For more information see DEPRECATED.

Author

  • Damien Garros (@dgarros)

Hint

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

© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.5/modules/aos_rack_type_module.html