ansible / ansible.builtin / v2.7.9 / module / _aos_rack_type
Removed in 2.9
Reason:This module does not support AOS 2.1 or later | Alternative:See new modules at U(https://www.ansible.com/ansible-apstra).
Manage AOS Rack Type
| "added in version" 2.3 of ansible.builtin"
Authors: Damien Garros (@dgarros)
deprecated | supported by community
pip
Install with pip install ansible==2.7.9
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 I(check) mode. It's using the AOS REST API.
- 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
id: description: - AOS Id of the Rack Type to manage (can't be used to create a new Rack Type), Only one of I(name), I(id) or I(content) can be set. name: description: - Name of the Rack Type 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 Rack Type (present or not). content: description: - 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 I(value). session: description: - An existing AOS session as obtained by M(aos_login) module. required: true