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

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 -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

Seems like the init script is not daemonizing properly.

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?

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.

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

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

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