Browse Source

Use available gitolite3 package on Ubuntu trusty

Sven Neuhaus 10 years ago
parent
commit
9a4d253d3e
2 changed files with 33 additions and 1 deletions
  1. 29
    0
      roles/git/tasks/gitolite_packaged.yml
  2. 4
    1
      roles/git/tasks/main.yml

+ 29
- 0
roles/git/tasks/gitolite_packaged.yml View File

@@ -0,0 +1,29 @@
1
+- name: Create gitolite group
2
+  group: name=git state=present
3
+
4
+- name: Create gitolite user
5
+  user: name=git state=present home=/home/git system=yes group=git
6
+
7
+- name: Add www-data to the git group
8
+  user: name=www-data groups=git append=yes
9
+
10
+- name: Install gitolite3 package
11
+  apt: pkg=gitolite3 state=installed
12
+
13
+- name: Copy .gitolite.rc file
14
+  copy: src=home_git_.gitolite.rc
15
+        dest=/home/git/.gitolite.rc
16
+        group=git
17
+        owner=git
18
+        mode=0644
19
+
20
+- name: Copy SSH public key to server
21
+  copy: src=gitolite.pub
22
+        dest=/home/git/{{ main_user_name }}.pub
23
+        group=git
24
+        owner=git
25
+        mode=0644
26
+
27
+- name: Setup gitolite
28
+  command: su - git -c 'gitolite setup -pk {{ main_user_name }}.pub'
29
+           chdir=/home/git

+ 4
- 1
roles/git/tasks/main.yml View File

@@ -1,2 +1,5 @@
1 1
 - include: gitolite.yml tags=gitolite
2
-- include: cgit.yml tags=cgit
2
+  when: ansible_distribution_release != 'trusty'
3
+- include: gitolite_packaged.yml tags=gitolite
4
+  when: ansible_distribution_release == 'trusty'
5
+- include: cgit.yml tags=cgit

Loading…
Cancel
Save