Skip to content

Instantly share code, notes, and snippets.

@ganeshrn
Created December 14, 2020 05:36
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
validate admin state criteria
- name: validate interface for admin state
ansible.utils.validate:
data: "{{ nxos_pyats_show_interface['parsed'] }}"
criteria:
- "{{ lookup('file', './criterias/nxos_show_interface_admin_criteria.json') | from_json }}"
engine: ansible.utils.jsonschema
ignore_errors: true
register: result
- name: print the interface names that does not satisfy the desired state
ansible.builtin.debug:
msg: "{{ item['data_path'].split('.')[0] }}"
loop: "{{ result['errors'] }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment