I've managed to solve the problem. The Mercurial task 'hangs' when logging in as sudo
user.
After removing the line sudo: yes
from both Playbooks, everything works as expected.
Working Playbook
- hosts: staging_mysql
user: ec2-user
vars_files:
- vars/mercurial.yml
tasks:
- name: Mercurial credentials setup
action: template src=templates/hgrc.j2 dest=/home/ec2-user/.hgrc
- name: Install Mercurial
action: yum name=hg
- name: Clone API repo
hg: dest=/home/ec2-user repo=https://bbusername@bitbucket.org/username/my-repo