Skip to content

Instantly share code, notes, and snippets.

@ganeshrn
Created December 14, 2020 05:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ganeshrn/d9a3049673bd8bec1cbd4b717cf56c99 to your computer and use it in GitHub Desktop.
Save ganeshrn/d9a3049673bd8bec1cbd4b717cf56c99 to your computer and use it in GitHub Desktop.
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