reading json like variable in ansible
<p>I'm new to ansible and I'm having a problem reading a value from json file in ansible role. my variable has a value like the following:</p>

<pre><code>{
  "queue": {
    "first": {
      "car": "bmw",
      "year": "1990",
      "model": "x3",
      "color": "blue"
    },
    "second": {
      "car": "bmw",
      "year": "2000",
      "model": "318",
      "color": "red"
    }
  }
}
</code></pre>

<p>I'm trying to print the color's value only to compare it with some other variable. I used <code>with_dict</code> to iterate over the json object (stored in variable called jsonVar) like the following:</p>

<pre><code>- name: test loop
  with_dict: "{{jsonVar}}"
  shell:  |
        if echo "blue" | grep -q "${{item.value.color}}" ; then
           echo "success"
</code></pre>

<p>so far there is no luck in getting the comparison of color's value from json to "blue" from the if statement. I was wondering if I'm doing something wrong?
thanks in advance!</p>