aboutsummaryrefslogtreecommitdiffstats
path: root/roles/git/tasks/gitolite.yml
blob: f926560b173be1b8bc30e712db3ba5b532d1aac4 (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: name=gitolite3 state=present
  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 }}