compare_dict

Synopsis

This module verifies that the result received from TextFSM for a particular template matches the expected output from a test scenario. It does so by comparing two lists of dictionaries going through elements of one and checking if the element ‘is in’ the second list.

Options

parameter required default choices comments
result yes
    a list of dictionaries received from ntc_show_command module
    sample yes
      a parsed sample from a test scenario

      Important

      Requires none

      Examples


      # verify that parsed result is the same as expected
      - compare_dict:
          result: "{{ item.item.response }}"
          sample: "{{ item.ansible_facts.parsed_sample }}"