New in version 2.3.
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. |
The below requirements are needed on the host that executes this module.
Parameter |
Choices/Defaults |
Comments |
---|---|---|
content
|
|
Datastructure of the Template 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 Template to manage (can't be used to create a new Template), Only one of name, id or src can be set.
|
name
|
|
Name of the Template to manage. Only one of name, id or src can be set.
|
session
required |
|
An existing AOS session as obtained by aos_login module.
|
state
|
|
Indicate what is the expected state of the Template (present or not).
|
- name: "Check if an Template exist by name"
aos_template:
session: "{{ aos_session }}"
name: "my-template"
state: present
- name: "Check if an Template exist by ID"
aos_template:
session: "{{ aos_session }}"
id: "45ab26fc-c2ed-4307-b330-0870488fa13e"
state: present
- name: "Delete an Template by name"
aos_template:
session: "{{ aos_session }}"
name: "my-template"
state: absent
- name: "Delete an Template by id"
aos_template:
session: "{{ aos_session }}"
id: "45ab26fc-c2ed-4307-b330-0870488fa13e"
state: absent
- name: "Access Template 1/3"
aos_template:
session: "{{ aos_session }}"
name: "my-template"
state: present
register: template
- name: "Save Template into a JSON file 2/3"
copy:
content: "{{ template.value | to_nice_json }}"
dest: template_saved.json
- name: "Save Template into a YAML file 2/3"
copy:
content: "{{ template.value | to_nice_yaml }}"
dest: template_saved.yaml
- name: "Load Template from File (Json)"
aos_template:
session: "{{ aos_session }}"
content: "{{ lookup('file', 'resources/template_saved.json') }}"
state: present
- name: "Load Template from File (yaml)"
aos_template:
session: "{{ aos_session }}"
content: "{{ lookup('file', 'resources/template_saved.yaml') }}"
state: present
This module is flagged as deprecated and will be removed in version { deprecated[‘removed_in’] | default(‘’) | string | convert_symbols_to_format }@. For more information see DEPRECATED.
Hint
If you notice any issues in this documentation you can edit this document to improve it.