community.general.hg – Manages Mercurial (hg) repositories¶
This plugin is part of the community.general collection (version 2.2.0).
To install it use:
ansible-galaxy collection install community.general.
To use it in a playbook, specify:
This module does not support push capability. See https://github.com/ansible/ansible/issues/31156.
If the task seems to be hanging, first verify remote host is in
known_hosts. SSH will prompt user to authorize the first contact with a remote host. To avoid this prompt, one solution is to add the remote host public key in
/etc/ssh/ssh_known_hostsbefore calling the hg module, with the following command: ssh-keyscan remote_host.com >> /etc/ssh/ssh_known_hosts.
As per 01 Dec 2018, Bitbucket has dropped support for TLSv1 and TLSv1.1 connections. As such, if the underlying system still uses a Python version below 2.7.9, you will have issues checking out bitbucket repositories. See https://bitbucket.org/blog/deprecating-tlsv1-tlsv1-1-2018-12-01.
- name: Ensure the current working copy is inside the stable branch and deletes untracked files if any. community.general.hg: repo: https://bitbucket.org/user/repo1 dest: /home/user/repo1 revision: stable purge: yes - name: Get information about the repository whether or not it has already been cloned locally. community.general.hg: repo: git://bitbucket.org/user/repo dest: /srv/checkout clone: no update: no