Add role git-repos
This commit is contained in:
parent
84755f8bb9
commit
a2816a152e
4 changed files with 50 additions and 0 deletions
|
@ -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
18
roles/git-repos/README.md
Normal 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
|
||||
...
|
||||
|
||||
```
|
23
roles/git-repos/tasks/main.yml
Normal file
23
roles/git-repos/tasks/main.yml
Normal 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 }}"
|
8
roles/git-repos/vars/main.yml
Normal file
8
roles/git-repos/vars/main.yml
Normal 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
|
Loading…
Reference in a new issue