# apt-get install play suddenly fails

**URL:** <https://forum.ansible.com/t/apt-get-install-play-suddenly-fails/14753>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [March 11, 2014, 5:03am UTC](https://forum.ansible.com/t/apt-get-install-play-suddenly-fails/14753 "2014-03-11T05:03:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Demetri\_Mouratis](https://avatars.discourse-cdn.com/v4/letter/d/f1d935/32.png) [@Demetri\_Mouratis](https://forum.ansible.com/u/Demetri_Mouratis)\
**Post date:** [March 11, 2014, 5:03am UTC](https://forum.ansible.com/t/apt-get-install-play-suddenly-fails/14753/1 "2014-03-11T05:03:15Z")

</div>

I’ve got this play in my playbook to install mysql-server:

#mysql server setup

- name: Install MySQL Server

apt: pkg={{ item }} state=present update\_cache=yes

with\_items:

- mysql-server

environment:

DEBIAN\_FRONTEND: noninteractive

This has worked flawlessly for me for some time.

Starting this evening, I began getting errors like:

TASK: [base | Install MySQL Server] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

failed: [127.0.0.1] =\> (item=mysql-server) =\> {“cmd”: [“DEBIAN\_FRONTEND=noninteractive”, “DEBIAN\_PRIORITY=critical”, “/usr/bin/apt-get”, “-y”, “-o”, “Dpkg::Options::=–force-confdef”, “-o”, “Dpkg::Options::=–force-confold”, “install”, “mysql-server”], “failed”: true, “item”: “mysql-server”, “rc”: 2}

msg: [Errno 2] No such file or directory

I tried upgrading ansible to 1.5.2a-precise-unstable by apt-get. Same problem. OS is ubuntu 12.04

What’s going on?

Thanks.

-D

---

<div class="post-metadata">

**Author:** ![tannerjc](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/tannerjc/32/985_2.png) [@tannerjc](https://forum.ansible.com/u/tannerjc)\
**Post date:** [March 11, 2014, 9:34pm UTC](https://forum.ansible.com/t/apt-get-install-play-suddenly-fails/14753/2 "2014-03-11T21:34:24Z")

</div>

This should be fixed by 1.5.2

---

<div class="post-metadata">

**Author:** ![Matt\_Maisel](https://avatars.discourse-cdn.com/v4/letter/m/e274bd/32.png) [@Matt\_Maisel](https://forum.ansible.com/u/Matt_Maisel)\
**Post date:** [March 11, 2014, 10:21pm UTC](https://forum.ansible.com/t/apt-get-install-play-suddenly-fails/14753/3 "2014-03-11T22:21:38Z")

</div>

Still seeing the same issue with 1.5.2

Matt

---

<div class="post-metadata">

**Author:** ![Demetri\_Mouratis](https://avatars.discourse-cdn.com/v4/letter/d/f1d935/32.png) [@Demetri\_Mouratis](https://forum.ansible.com/u/Demetri_Mouratis)\
**Post date:** [March 11, 2014, 11:42pm UTC](https://forum.ansible.com/t/apt-get-install-play-suddenly-fails/14753/4 "2014-03-11T23:42:50Z")

</div>

On further investigation, the

environment:

DEBIAN\_FRONTEND: noninteractive

seemed to be unnecessary and indeed continued to cause problems even post-patch.

Does that make sense?

The mysql-server deb is particularly horrible as it prompts for user input (root password) at least twice and as many as three times. I found this example which I used successfully prior to 1.5 release:

[https://gist.github.com/silviud/6382400](https://gist.github.com/silviud/6382400)

---

<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:** [March 12, 2014, 1:34am UTC](https://forum.ansible.com/t/apt-get-install-play-suddenly-fails/14753/5 "2014-03-12T01:34:08Z")

</div>

(approving some old first-posts so these may be a bit out of date, but replying to them now)

The 1.5.2 tarball from this AM lacked a git-cherry-pick.

Since then, about 10:50 AM EDT, we rebuild the tarball, moved the git tag, and fixed the problem.

pypi already has the right ansible as does [releases.ansible.com](http://releases.ansible.com)

Those using the rquillo PPA may have a mispackaged Ansible 1.5.2, that was actually a 1.5.1, which was a slight oversight on his end I think, but we’re not sure.

We are also looking to hosting a PPA ourselves very soon now.

If anybody is _still_ seeing problems on Ubuntu, install from pip or the tarball, and you will be good to go!

---

<div class="post-metadata">

**Author:** ![Jesus\_Garcia\_Crespo](https://avatars.discourse-cdn.com/v4/letter/j/958977/32.png) [@Jesus\_Garcia\_Crespo](https://forum.ansible.com/u/Jesus_Garcia_Crespo)\
**Post date:** [March 12, 2014, 6:26am UTC](https://forum.ansible.com/t/apt-get-install-play-suddenly-fails/14753/6 "2014-03-12T06:26:36Z")

</div>

Thanks Michael, that worked!
