aboutsummaryrefslogtreecommitdiffstats
path: root/roles/git/tasks/gitolite.yml
blob: 09a6ac8dd61cd455dd1385cac2fcd7d17895de07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
- name: Create gitolite group
  group: name=git state=present

- name: Create gitolite user
  user: name=git state=present home={{ gitolite_homedir }} system=yes group=git

- name: Add www-data to the git group
  user: name=www-data groups=git append=yes

- name: Install gitolite3 package
  apt: pkg=gitolite3 state=installed
  tags:
    - dependencies

- name: Copy .gitolite.rc file
  template:
        src=home_git_gitolite_rc.j2
        dest={{ gitolite_homedir }}/.gitolite.rc
        group=git
        owner=git
        mode=0644

- name: Copy SSH public key to server
  copy: src={{ gitolite_admin_pubkey }}
        dest={{ gitolite_homedir}}/{{ main_user_name }}.pub
        group=git
        owner=git
        mode=0644

- name: Setup gitolite
  command: su - git -c 'gitolite setup -pk {{ main_user_name }}.pub'
           chdir={{ gitolite_homedir }}