aboutsummaryrefslogtreecommitdiff
path: root/gerboweb/deploy/setup_git.yml
diff options
context:
space:
mode:
Diffstat (limited to 'gerboweb/deploy/setup_git.yml')
-rw-r--r--gerboweb/deploy/setup_git.yml54
1 files changed, 34 insertions, 20 deletions
diff --git a/gerboweb/deploy/setup_git.yml b/gerboweb/deploy/setup_git.yml
index 6e7d621..d1789bd 100644
--- a/gerboweb/deploy/setup_git.yml
+++ b/gerboweb/deploy/setup_git.yml
@@ -43,26 +43,34 @@
name: uwsgi-app@cgit.socket
enabled: yes
-- name: Copy gitolite admin pubkey
- copy:
- src: ~/.ssh/id_ed25519.gitolite.pub
- dest: /tmp/jaseg-gitolite.pub
- owner: gitolite3
- group: gitolite3
-
-- name: Run gitolite initialization
- command: gitolite setup -pk /tmp/jaseg-gitolite.pub
- become: true
- become_method: su
- become_user: gitolite3
- become_flags: '-s /bin/sh'
- args:
- creates: /var/lib/gitolite3/projects.list
-
-- name: Remove leftover admin pubkey
- file:
- state: absent
- path: /tmp/jaseg-gitolite.pub
+- name: Check if gitolite ssh config exists
+ stat:
+ path: /var/lib/gitolite3/.ssh/authorized_keys
+ register: gitolite_ssh_keys_stat
+
+- name: Gitolite admin key setup
+ block:
+ - name: Copy gitolite admin pubkey
+ copy:
+ src: ~/.ssh/id_ed25519.gitolite.pub
+ dest: /tmp/jaseg-gitolite.pub
+ owner: gitolite3
+ group: gitolite3
+
+ - name: Run gitolite initialization
+ command: gitolite setup -pk /tmp/jaseg-gitolite.pub
+ become: true
+ become_method: su
+ become_user: gitolite3
+ become_flags: '-s /bin/sh'
+ args:
+ creates: /var/lib/gitolite3/projects.list
+
+ - name: Remove leftover admin pubkey
+ file:
+ state: absent
+ path: /tmp/jaseg-gitolite.pub
+ when: not gitolite_ssh_keys_stat.stat.exists
- name: Allow uwsgi group to access gitolite repo dir
file:
@@ -113,3 +121,9 @@
home: "{{ getent_passwd['gitolite3'][4] }}"
uid: "{{ getent_passwd['gitolite3'][1] }}"
+- name: Hack to fix cgit handling for restructuredtext readmes
+ file:
+ src: /usr/bin/rst2html
+ dest: /usr/bin/rst2html.py
+ state: link
+