# script output variable causes an error (\\r\\n)

**URL:** <https://forum.ansible.com/t/script-output-variable-causes-an-error-r-n/13082>\
**Category:** Ansible Project\
**Created:** [July 8, 2013, 3:55pm UTC](https://forum.ansible.com/t/script-output-variable-causes-an-error-r-n/13082 "2013-07-08T15:55:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lars\_svenson](https://avatars.discourse-cdn.com/v4/letter/l/b782af/32.png) [@lars\_svenson](https://forum.ansible.com/u/lars_svenson)\
**Post date:** [July 8, 2013, 3:55pm UTC](https://forum.ansible.com/t/script-output-variable-causes-an-error-r-n/13082/1 "2013-07-08T15:55:52Z")

</div>

Dear community,

I’m using ansible in version 1.2 in combination with debian 6.0

In one playbook I’m doing a step that does grep the name of the user who owns this domain:

- name: get domain and db user  
action: script …/scripts/get\_user.sh $DOMAIN  
register: USER  
ignore\_errors: True

The output is for example peter.

The next step is:

- name: delete user and group  
action: shell deluser -f {{USER.stdout}}

On my testing system all does work well … in the production system (debian 6.0 , ansible 1.2) I get an error:

TASK: [delete user and group] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
failed: [productionsystem] =\> {“changed”: true, “cmd”: "deluser -f peter\r\n ", “delta”: “0:00:00.061755”, “end”: “2013-07-07 19:31:45.344276”, “rc”: 2, “start”: “2013-07-07 19:31:45.282521”}  
’ does not exist./deluser: The user `peter  
FATAL: all hosts have already failed – aborting

First issue is , that \r\n got into USER.stdout (on one system , not on the other one)

Second is that this ’ does not exist./deluser: The user `peter , should be:

deluser: The user `peter’ does not exist.  
It get shrinked. Why ( this is just a question of interest in ansible or how ansible works)

Does anyone have any suggestions or ideas? What am I doing wrong.

Thank you in advance

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [July 8, 2013, 4:03pm UTC](https://forum.ansible.com/t/script-output-variable-causes-an-error-r-n/13082/2 "2013-07-08T16:03:33Z")

</div>

There was a reported bug that the options to the script module are not getting templated.

It’s in my queue of things to investigate and we have a github tracking this, though if people would like to beat me to it, that would be great!

–Michael

---

<div class="post-metadata">

**Author:** ![lars\_svenson](https://avatars.discourse-cdn.com/v4/letter/l/b782af/32.png) [@lars\_svenson](https://forum.ansible.com/u/lars_svenson)\
**Post date:** [October 22, 2013, 4:50pm UTC](https://forum.ansible.com/t/script-output-variable-causes-an-error-r-n/13082/3 "2013-10-22T16:50:03Z")

</div>

Can I raise this question again? 🙂

Any efforts or work arounds?

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [October 23, 2013, 6:38pm UTC](https://forum.ansible.com/t/script-output-variable-causes-an-error-r-n/13082/4 "2013-10-23T18:38:02Z")

</div>

This was already fixed.

If you think there’s a new issue, please file at ticket after reading the “Contributing.md” instructions in github about what we’re looking.

Thanks!
