# Ansible 1.8.2 Error whilst debugging variable.stdout - "A variable inserted a new parameter into the module args"

**URL:** <https://forum.ansible.com/t/ansible-1-8-2-error-whilst-debugging-variable-stdout-a-variable-inserted-a-new-parameter-into-the-module-args/17811>\
**Category:** Ansible Project\
**Created:** [March 23, 2015, 2:13pm UTC](https://forum.ansible.com/t/ansible-1-8-2-error-whilst-debugging-variable-stdout-a-variable-inserted-a-new-parameter-into-the-module-args/17811 "2015-03-23T14:13:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike\_S](https://avatars.discourse-cdn.com/v4/letter/m/67e7ee/32.png) [@Mike\_S](https://forum.ansible.com/u/Mike_S)\
**Post date:** [March 23, 2015, 2:13pm UTC](https://forum.ansible.com/t/ansible-1-8-2-error-whilst-debugging-variable-stdout-a-variable-inserted-a-new-parameter-into-the-module-args/17811/1 "2015-03-23T14:13:26Z")

</div>

Hi all,

I’ve detailed this issue here [https://github.com/ansible/ansible/issues/10519](https://github.com/ansible/ansible/issues/10519)

To summarise, this was my task,

`

```auto
- name: Build base image
  shell: docker build -t {{docker_image_namespace}}/trusty-base {{docker_yard_dir}}/base
  register: docker_build

- debug: msg="{{ docker_build.stdout }}"

```

`

and the failure,

`

```auto
TASK: [docker-base | debug msg="{{ docker_build.stdout }}"] *******
fatal: [10.22.22.22] => A variable inserted a new parameter into the module args. Be sure to quote variables if they contain equal signs (for example: "{{var}}").

FATAL: all hosts have already failed -- aborting

```

`

I’ve only been able to get this to work as `- debug: var=docker_build.stdout`, however, this does not print STDOUT, but rather shows the var contents, including ‘\n’ chars in a really long string.

Any thoughts on how I can get this sorted?

Any suggestions on getting these images built as an async. job as well?

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [March 23, 2015, 2:18pm UTC](https://forum.ansible.com/t/ansible-1-8-2-error-whilst-debugging-variable-stdout-a-variable-inserted-a-new-parameter-into-the-module-args/17811/2 "2015-03-23T14:18:26Z")

</div>

I might recommend using ‘var’ instead of ‘msg’ in debug. The problem is likely that the output contains quotes and is breaking the quoting.

Something like:

- debug: var=docker\_build.stdout

---

<div class="post-metadata">

**Author:** ![Mike\_S](https://avatars.discourse-cdn.com/v4/letter/m/67e7ee/32.png) [@Mike\_S](https://forum.ansible.com/u/Mike_S)\
**Post date:** [March 23, 2015, 2:45pm UTC](https://forum.ansible.com/t/ansible-1-8-2-error-whilst-debugging-variable-stdout-a-variable-inserted-a-new-parameter-into-the-module-args/17811/3 "2015-03-23T14:45:17Z")

</div>

I’ve resorted to using the docker tools, to get the image setup

`

- name: Build base image  
docker\_image: path=“{{docker\_yard\_dir}}/base” name=“{{docker\_image\_namespace}}/trusty-base” state=present  
register: docker\_build  
`

---

<div class="post-metadata">

**Author:** ![Mike\_S](https://avatars.discourse-cdn.com/v4/letter/m/67e7ee/32.png) [@Mike\_S](https://forum.ansible.com/u/Mike_S)\
**Post date:** [March 23, 2015, 6:26pm UTC](https://forum.ansible.com/t/ansible-1-8-2-error-whilst-debugging-variable-stdout-a-variable-inserted-a-new-parameter-into-the-module-args/17811/4 "2015-03-23T18:26:35Z")

</div>

Hey Matt,

Thanks, yeah I tried this but as you guessed, the output is received as string, but I want that string to be echoed into my terminal’s tty.

I’ve now switched to building the image using docker-py and Ansible’s docker module,

`

- name: Build base image  
docker\_image: path=“{{docker\_yard\_dir}}/base” name="{{docker\_image\_namespace}}/trusty-base"state=present  
register: docker\_build

`

Any advice on how I can get the stdout info here, would it still be a case of accessing `docker_build.stdout`?

Also, what about running this as an async job (which I did); is there away to get an async job to trigger (say via `notify`) a completion message? I don’t mind if it’s via email or using one of the push services Ansible can hook into.

Thanks for your help!

Best, M.
