Add role git-repos

This commit is contained in:
Tobias Hachmer 2017-09-11 12:48:16 +02:00
parent 84755f8bb9
commit a2816a152e
4 changed files with 50 additions and 0 deletions

View file

@ -6,6 +6,7 @@
- prerequisites
- server-repos
- server-basic
- git-repos
- service-haveged
- service-ntpd
- kmod-batman

18
roles/git-repos/README.md Normal file
View file

@ -0,0 +1,18 @@
# Ansible role git-repos
Diese Ansible role klont wichtige git Repositories.
- installiert git
- legt /home/admin/clones an
- klont alle git Repositories aus dem Dictionary `common_repos`
## Benötigte Variablen
- Dictionary `common_repos` # role variable
```
common_repos:
name: # name des Repositories == Ordner Name
repo_url: # HTTP-URL zum Repository
...
```

View file

@ -0,0 +1,23 @@
---
- name: install git packages
apt:
name: "{{ item }}"
state: present
with_items:
- git
become: true
- name: ensure git directory is present
file:
path: /home/admin/clones
state: directory
mode: 0755
owner: admin
group: admin
become: true
- name: clone git repositories
git:
repo: "{{ item.value.repo_url }}"
dest: "/home/admin/clones/{{ item.key }}"
with_dict: "{{ common_repos }}"

View file

@ -0,0 +1,8 @@
---
common_repos:
backend-scripts:
repo_url: https://github.com/freifunk-mwu/backend-scripts.git
icvpn-meta:
repo_url: https://github.com/freifunk/icvpn-meta.git
icvpn-scripts:
repo_url: https://github.com/freifunk/icvpn-scripts.git