Ansible role to provision SCM repositories. It can be used to set up e.g. a local development machine with houndreds of repositories.
This role uses task includes with with_ loops. Therefor, ansible 2.0 or newer is required.
A list of repositories. Each item needs to have the following keys:
- url: Protocol address of the git/hg repository..
- dest: Absolute path of where the repository should be checked out to.
- type (optional): Type of the repository. Can be either git (default) or hg.
The root folder in which rpositories are cloned.
The email address for the repository author when adding commits.
The user name for the repository author when adding commits.
If no (default), do not retrieve new revisions from the origin repository.
If no (default), do not retrieve new revisions from the origin repository
This role has no dependencies.
This role can be used to set up repositories for local development, e.g. for different customers:
- hosts: localhost
connection: local
gather_facts: false
roles:
- role: scm
user_email: '[email protected]'
user_name: 'Your Name'
repo_root: '/home/user/development/customer1'
repo_list:
- url: '[email protected]:customer1/repo1.git'
dest: 'project_1/repo1'
- url: [email protected]:customer1/repo2.git
dest: project_2/repo2
- url: ssh://[email protected]/customer1/repo3
dest: project_1/repo3
type: hg
- role: scm
user_email: '[email protected]'
user_name: 'Your Name'
repo_root: '/home/user/development/customer2'
repo_list:
- url: '[email protected]:customer2/project.git'
dest: 'project'
MIT