# "apt-get -y install rabbitmq-server" hangs when installed via a playbook

**URL:** <https://forum.ansible.com/t/apt-get-y-install-rabbitmq-server-hangs-when-installed-via-a-playbook/12209>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [January 17, 2013, 6:59pm UTC](https://forum.ansible.com/t/apt-get-y-install-rabbitmq-server-hangs-when-installed-via-a-playbook/12209 "2013-01-17T18:59:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steve1](https://avatars.discourse-cdn.com/v4/letter/s/3da27b/32.png) [@Steve1](https://forum.ansible.com/u/Steve1)\
**Post date:** [January 17, 2013, 6:59pm UTC](https://forum.ansible.com/t/apt-get-y-install-rabbitmq-server-hangs-when-installed-via-a-playbook/12209/1 "2013-01-17T18:59:34Z")

</div>

When I run the following task from a playbook, it hangs forever:

- command: apt-get -y install rabbitmq-server

If I instead run it from the command line, it works just fine:

ansible [ec2-host.compute-1.amazonaws.com](http://ec2-host.compute-1.amazonaws.com) -m command -a “apt-get -y install rabbitmq-server” --user=ubuntu --sudo --private-key=/root/.ssh/mykey.pem

Any thoughts on how to fix this?

Here is the output from ps on the VM. Notice “[apt-get] ”

root 22605 0.0 0.0 4280 580 ? S 17:17 0:00 /bin/sh -c /usr/bin/python /home/ubuntu/.ansible/tmp/ansible-1358443075.03-39627263471070/command; rm -rf /home/ubuntu/.ansible/tmp/ansible-1358443075.03-39627263471070/ \>/dev/null 2\>&1

root 22606 0.0 1.1 33736 6756 ? S 17:17 0:00 /usr/bin/python /home/ubuntu/.ansible/tmp/ansible-1358443075.03-39627263471070/command

root 22607 0.2 0.0 0 0 ? Z 17:17 0:01 [apt-get]

rabbitmq 23358 0.0 0.0 6816 320 ? S 17:18 0:00 /usr/lib/erlang/erts-5.8.3/bin/epmd -daemon

root 23363 0.0 0.0 4280 584 ? Ss 17:18 0:00 sh -c /usr/sbin/rabbitmq-server \> /var/log/rabbitmq/startup\_log 2\> /var/log/rabbitmq/startup\_err

root 23378 0.0 0.0 4280 580 ? S 17:18 0:00 /bin/sh /usr/sbin/rabbitmq-server

rabbitmq 23382 0.0 0.2 37832 1316 ? S 17:18 0:00 su rabbitmq -s /bin/sh -c /usr/lib/rabbitmq/bin/rabbitmq-server

rabbitmq 23385 0.0 0.0 4280 580 ? S 17:18 0:00 sh -c /usr/lib/rabbitmq/bin/rabbitmq-server

rabbitmq 23386 0.1 4.2 52740 26064 ? Sl 17:18 0:00 /usr/lib/erlang/erts-5.8.3/bin/beam -W w -K true -A30 -P 1048576 – -root /usr/lib/erlang -progname erl – -home /var/lib/rabbitmq – -noshell -noinput -sname rabbit@ip-abc -boot /var/lib/rabbitmq/mnesia/rabbit@ip-abcplugins-expand/rabbit -kernel inet\_default\_connect\_options [{nodelay,true}] -sasl errlog\_type error -kernel error\_logger {file,“/var/log/rabbitmq/rabbit@ip-abc.log”} -sasl sasl\_error\_logger {file,“/var/log/rabbitmq/rabbit@ip-abc-sasl.log”} -os\_mon start\_cpu\_sup true -os\_mon start\_disksup false -os\_mon start\_memsup false -mnesia dir “/var/lib/rabbitmq/mnesia/rabbit@ip-abc”

rabbitmq 23447 0.0 0.0 4172 324 ? Ss 17:18 0:00 /usr/lib/erlang/lib/os\_mon-2.2.5/priv/bin/cpu\_sup

rabbitmq 23448 0.0 0.0 6784 348 ? Ss 17:18 0:00 inet\_gethost 4

rabbitmq 23449 0.0 0.1 8884 644 ? S 17:18 0:00 inet\_gethost 4

---

<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:** [January 17, 2013, 9:02pm UTC](https://forum.ansible.com/t/apt-get-y-install-rabbitmq-server-hangs-when-installed-via-a-playbook/12209/2 "2013-01-17T21:02:08Z")

</div>

Seems like the init script is not daemonizing properly.

---

<div class="post-metadata">

**Author:** ![Lorin\_Hochstein1](https://avatars.discourse-cdn.com/v4/letter/l/ce73a5/32.png) [@Lorin\_Hochstein1](https://forum.ansible.com/u/Lorin_Hochstein1)\
**Post date:** [January 17, 2013, 9:24pm UTC](https://forum.ansible.com/t/apt-get-y-install-rabbitmq-server-hangs-when-installed-via-a-playbook/12209/3 "2013-01-17T21:24:40Z")

</div>

This isn’t directly relevant to your problem, but is there a reason you’re using the command module instead of the apt module for installing this package?

---

<div class="post-metadata">

**Author:** ![Steve1](https://avatars.discourse-cdn.com/v4/letter/s/3da27b/32.png) [@Steve1](https://forum.ansible.com/u/Steve1)\
**Post date:** [January 18, 2013, 4:29pm UTC](https://forum.ansible.com/t/apt-get-y-install-rabbitmq-server-hangs-when-installed-via-a-playbook/12209/4 "2013-01-18T16:29:01Z")

</div>

I had started with the apt module (providing about 20 packages using with\_items), but it was hanging so I quickly determined it was rabbitmq-server that was causing the issue so then I started debugging it.

---

<div class="post-metadata">

**Author:** ![Steve1](https://avatars.discourse-cdn.com/v4/letter/s/3da27b/32.png) [@Steve1](https://forum.ansible.com/u/Steve1)\
**Post date:** [January 18, 2013, 5:45pm UTC](https://forum.ansible.com/t/apt-get-y-install-rabbitmq-server-hangs-when-installed-via-a-playbook/12209/5 "2013-01-18T17:45:35Z")

</div>

Turns out it has to do with fireball mode. Switched back to paramiko and it works.

apt-get + rabbitmq-server + fireball = fail (for now)

---

<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:** [January 18, 2013, 6:32pm UTC](https://forum.ansible.com/t/apt-get-y-install-rabbitmq-server-hangs-when-installed-via-a-playbook/12209/6 "2013-01-18T18:32:58Z")

</div>

Ok, if you have any fixes for fireball mode, they are welcome.
