diff options
author | Guilhem Moulin <guilhem@fripost.org> | 2015-05-31 18:02:27 +0200 |
---|---|---|
committer | Guilhem Moulin <guilhem@fripost.org> | 2015-06-07 02:53:59 +0200 |
commit | e63885bcc0d46bfe58a32fcfc1d02daae8735929 (patch) | |
tree | 09ecd98acbedd958b23ae6570c956666639f312b /roles/git/tasks/gitolite.yml | |
parent | 18fb13fb6bdbf85fddfdaf05bd5fb3ab1db3b9dd (diff) |
Git (gitolite + git-http-backend + gitweb) configuration
By default repos are be readable by gitweb and the web server ('gitweb' and
'www-data' are both in the 'gitolite' group). Private repo owners will have
'chmod -R og-rwx' manually.
To automatically add new repos to gitweb's 'project.list' file, make it
readable to the special 'gitweb' user.
See /usr/share/doc/gitolite3/README.txt.gz for details.
Diffstat (limited to 'roles/git/tasks/gitolite.yml')
-rw-r--r-- | roles/git/tasks/gitolite.yml | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/roles/git/tasks/gitolite.yml b/roles/git/tasks/gitolite.yml new file mode 100644 index 0000000..5cbce23 --- /dev/null +++ b/roles/git/tasks/gitolite.yml @@ -0,0 +1,36 @@ +- name: Install gitolite + apt: pkg=gitolite3 + +- name: Create a user 'gitolite' + user: name=gitolite system=yes + groups=ssh-login + home=/var/lib/gitolite + shell=/bin/sh + password=* + state=present + +- name: Create directory ~gitolite/.ssh + file: path=/var/lib/gitolite/.ssh + state=directory + owner=gitolite group=gitolite + mode=0700 + +- name: Create /var/lib/gitolite/projects.list + file: path=/var/lib/gitolite/projects.list + owner=gitolite group=gitolite + mode=0644 + +# See /usr/share/doc/gitolite3/README.txt.gz for gitolite initiation or +# migration. +# sudo -u gitolite gitolite setup -pk /path/to/id_rsa + +- name: Configure gitolite + lineinfile: dest=/var/lib/gitolite/.gitolite.rc + "regexp=^(\\s*{{ item.var }}\\s*=>\\s*)" + "line= {{ item.var }} => {{ item.value }}," + owner=root group=root + mode=0644 + with_items: + # See /usr/share/doc/gitolite3/README.txt.gz + - { var: UMASK, value: "0027" } + - { var: GIT_CONFIG_KEYS, value: "'gitweb\\..* gc\\..*'" } |