# no tty

**URL:** <https://forum.ansible.com/t/no-tty/16279>\
**Category:** Ansible Project\
**Created:** [September 18, 2014, 8:38pm UTC](https://forum.ansible.com/t/no-tty/16279 "2014-09-18T20:38:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guy\_Matz](https://avatars.discourse-cdn.com/v4/letter/g/57b2e6/32.png) [@Guy\_Matz](https://forum.ansible.com/u/Guy_Matz)\
**Post date:** [September 18, 2014, 8:38pm UTC](https://forum.ansible.com/t/no-tty/16279/1 "2014-09-18T20:38:30Z")

</div>

Hello! Anyone know if there is a way to specify no tty for a play? I saw on the list that someone had gotten around it by using screen, but I was wondering if there was a better way.

Thanks!  
Guy

---

<div class="post-metadata">

**Author:** ![Guy\_Matz1](https://avatars.discourse-cdn.com/v4/letter/g/b5e925/32.png) [@Guy\_Matz1](https://forum.ansible.com/u/Guy_Matz1)\
**Post date:** [September 19, 2014, 7:14pm UTC](https://forum.ansible.com/t/no-tty/16279/2 "2014-09-19T19:14:50Z")

</div>

Hello! Anyone know if there is a way to specify ‘no tty’ for a play? I have a command that calls a script that is prompting for overwrites if it thinks there’s a tty attached . … I saw on the list that someone had gotten around it by using screen, but I was wondering if there was a better way.

Thanks!

Guy

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [September 21, 2014, 7:33pm UTC](https://forum.ansible.com/t/no-tty/16279/3 "2014-09-21T19:33:50Z")

</div>

What problems are you having?

---

<div class="post-metadata">

**Author:** ![Guy\_Matz](https://avatars.discourse-cdn.com/v4/letter/g/57b2e6/32.png) [@Guy\_Matz](https://forum.ansible.com/u/Guy_Matz)\
**Post date:** [September 22, 2014, 1:32pm UTC](https://forum.ansible.com/t/no-tty/16279/4 "2014-09-22T13:32:27Z")

</div>

I am trying to run a script using the command module . . . when the script thinks it has a tty it prompts, asking if it should overwrite files. When the script thinks there is no tty it just overwrites files, which is the behavior what I want.

Thanks!

---

<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:** [September 22, 2014, 2:26pm UTC](https://forum.ansible.com/t/no-tty/16279/5 "2014-09-22T14:26:52Z")

</div>

I would assume that if you specified -T in ANSIBLE\_SSH\_ARGS (env var) or in ssh\_args in ansible.cfg ([http://docs.ansible.com/intro\_configuration.html#ssh-args](http://docs.ansible.com/intro_configuration.html#ssh-args)) that it would disable the tty.

Unfortunately this is global, and I am unsure how all of the modules would work with this configuration.

Can you modify the script to take an argument that will also force the same behavior as not having a tty? Or perhaps an environment var?

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [September 22, 2014, 5:24pm UTC](https://forum.ansible.com/t/no-tty/16279/6 "2014-09-22T17:24:57Z")

</div>

Sometimes scripts will also behave better if given a --batch flag or redirected \< /dev/null for input.
