aboutsummaryrefslogtreecommitdiff
path: root/gerboweb/deploy/setup_git.yml
diff options
context:
space:
mode:
authorjaseg <code@jaseg.net>2020-12-30 11:38:27 +0100
committerjaseg <code@jaseg.net>2020-12-30 11:38:27 +0100
commit6fbea50682a52b9210b06f73d36c5f575d16362c (patch)
tree8abde96c95cf0373222d13b90dafbe6bc6c4157b /gerboweb/deploy/setup_git.yml
parentb47ca7bbdc725d27f9f2875c11026b80e4affa4e (diff)
downloadgerbolyze-6fbea50682a52b9210b06f73d36c5f575d16362c.tar.gz
gerbolyze-6fbea50682a52b9210b06f73d36c5f575d16362c.tar.bz2
gerbolyze-6fbea50682a52b9210b06f73d36c5f575d16362c.zip
Tag git setup foo
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
+