# 'rc' check failure - 'dict object' has no attribute 'rc'

**URL:** <https://forum.ansible.com/t/rc-check-failure-dict-object-has-no-attribute-rc/27979>\
**Category:** Ansible Project\
**Created:** [July 7, 2018, 7:14am UTC](https://forum.ansible.com/t/rc-check-failure-dict-object-has-no-attribute-rc/27979 "2018-07-07T07:14:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Imam\_Toufique](https://avatars.discourse-cdn.com/v4/letter/i/71e660/32.png) [@Imam\_Toufique](https://forum.ansible.com/u/Imam_Toufique)\
**Post date:** [July 7, 2018, 7:14am UTC](https://forum.ansible.com/t/rc-check-failure-dict-object-has-no-attribute-rc/27979/1 "2018-07-07T07:14:36Z")

</div>

Hi,

I am new in ansible world, trying to figure out playbook where I use ‘grep’ to check for netmask address from a text file and capture the exit code with ‘register’ ( see below).

My vars/main.yml looks like this:

ipmitool\_lan:  
root:  
netmask: 255.0.0.0  
defgw: 10.1.1.1

My tasks/main.yml looks like this:

---

<div class="post-metadata">

**Author:** ![Daria\_Serkova](https://avatars.discourse-cdn.com/v4/letter/d/a587f6/32.png) [@Daria\_Serkova](https://forum.ansible.com/u/Daria_Serkova)\
**Post date:** [July 8, 2018, 3:03pm UTC](https://forum.ansible.com/t/rc-check-failure-dict-object-has-no-attribute-rc/27979/2 "2018-07-08T15:03:24Z")

</div>

Hi Imam Toufique

```auto
ipmask variable contains complex data structure, just try 

```

---

<div class="post-metadata">

**Author:** ![Imam\_Toufique](https://avatars.discourse-cdn.com/v4/letter/i/71e660/32.png) [@Imam\_Toufique](https://forum.ansible.com/u/Imam_Toufique)\
**Post date:** [July 8, 2018, 6:36pm UTC](https://forum.ansible.com/t/rc-check-failure-dict-object-has-no-attribute-rc/27979/3 "2018-07-08T18:36:15Z")

</div>

Hi Daria,

that worked! thanks. But, I am not sure how it did though 🙂 ‘-debug’ output for ipmask produces the following:

TASK [ipmi : debug] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
task path: /data/ansible-hpc/production/global/pkgs/20180703\_2227/roles/ipmi/tasks/main.yml:15  
ok: [compute-13-11] =\> {  
“\<type ‘dict’\>”: "VARIABLE IS NOT DEFINED!: "  
}

Would you mind explaining your solution a bit?

thanks again! Very much appreciated!

---

<div class="post-metadata">

**Author:** ![Karl\_Auer](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@Karl\_Auer](https://forum.ansible.com/u/Karl_Auer)\
**Post date:** [July 8, 2018, 11:22pm UTC](https://forum.ansible.com/t/rc-check-failure-dict-object-has-no-attribute-rc/27979/4 "2018-07-08T23:22:02Z")

</div>

When outputting a variable with debug, you do NOT use the curly braces.

If you use the curly braces, you are asking debug to output a variable with the _name contained in ipmask_, rather than the _value of ipmask itself_. Because the value contained in ipmask is not the name of a variable, debug complains that it is not defined.

Run this to see what I am talking about:

---

<div class="post-metadata">

**Author:** ![Ramesh\_AR](https://avatars.discourse-cdn.com/v4/letter/r/3e96dc/32.png) [@Ramesh\_AR](https://forum.ansible.com/u/Ramesh_AR)\
**Post date:** [July 8, 2018, 11:23pm UTC](https://forum.ansible.com/t/rc-check-failure-dict-object-has-no-attribute-rc/27979/5 "2018-07-08T23:23:49Z")

</div>

Does anyone know how to do vmotion all the vms from one host to another hosts by using ansible.
