# Ansible error while evaluting condition with two group vars

**URL:** <https://forum.ansible.com/t/ansible-error-while-evaluting-condition-with-two-group-vars/28091>\
**Category:** Ansible Project\
**Created:** [July 19, 2018, 1:07pm UTC](https://forum.ansible.com/t/ansible-error-while-evaluting-condition-with-two-group-vars/28091 "2018-07-19T13:07:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ansiblekrazy](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@ansiblekrazy](https://forum.ansible.com/u/ansiblekrazy)\
**Post date:** [July 19, 2018, 1:07pm UTC](https://forum.ansible.com/t/ansible-error-while-evaluting-condition-with-two-group-vars/28091/1 "2018-07-19T13:07:23Z")

</div>

abd,cde are two groups in inventory files. Getting error while running the playbook:

```auto
 hosts: abc,cde
  tasks:
- name: Check 
  shell: ls -ltrh /tmp/test1/ | wc -l
  register : something_result
  when: "'abc' in group_names"

- name: True
  shell: ls -ltrh /tmp/test1/ | wc -l
  register: something2_result
  when: "'cde' in group_names"
  failed_when: something2_result != something_result

```

Error: “The conditional check ‘something2\_result.stdout == something\_result.stdout’ failed. The error was: error while evaluating conditional (something2\_result.stdout == something\_result.stdout): ‘dict object’ has no attribute ‘stdout’”

The reason is, it is only picking getting variable value from abc group, not working for cde
