you can execute shell commands, just not ones that expect interactivity as they hold the tty (this happens with any background ssh execution).
for apt commands, yes use the apt module, it takes care of 99% f these issues. -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.