aboutsummaryrefslogtreecommitdiffstats
path: root/roles/git/tasks/gitolite.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/git/tasks/gitolite.yml')
-rw-r--r--roles/git/tasks/gitolite.yml31
1 files changed, 31 insertions, 0 deletions
diff --git a/roles/git/tasks/gitolite.yml b/roles/git/tasks/gitolite.yml
new file mode 100644
index 0000000..8e2538f
--- /dev/null
+++ b/roles/git/tasks/gitolite.yml
@@ -0,0 +1,31 @@
+- name: Create gitolite group
+ group: name=git state=present
+
+- name: Create gitolite user
+ user: name=git state=present home=/home/git 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
+ copy: src=home_git_.gitolite.rc
+ dest=/home/git/.gitolite.rc
+ group=git
+ owner=git
+ mode=0644
+
+- name: Copy SSH public key to server
+ copy: src=gitolite.pub
+ dest=/home/git/{{ 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=/home/git