Ansible apt module hangs

Hi,

When I try to install apt package using ansible apt module, it hangs.

Command:
ansible tu --ask-pass -m apt -a “pkg=apache2 state=installed update_cache=yes force=yes” --sudo

ps on the remote system:

554 pts/1 S+ 0:00 sudo -p [sudo via ansible, key=…] password: -u root /bin/sh -c /usr/bin/python -tt /home/user/.ansible/tmp/ansible-1358516983.12-245746889740468/apt; rm -rf /home/user/.ansible/tmp/ansible-1358516983.12-245746889740468/ >/dev/null 2>&1

The remote system is clean installation of Ubuntu 12.04.

Do you know what is the problem and how to fix it?

Best regards,
Anton.

can you try the same command with -K?

Thank you, Brian, it works!

Should I always use -K switch or only for apt command?

Best regards,
Anton.

no, I think you mistook ask_password (-k) for sudo_ask_password (-K),
the first is for login user.