Browse Source

The gogs user actually needs the ssh key for the wiki git repo because is is executing the git hooks

Till Klocke 10 năm trước cách đây
mục cha
commit
a9a04d29aa
1 tập tin đã thay đổi với 16 bổ sung và 0 xóa
  1. 16 0
      roles/service-gogs/tasks/gogs.yml

+ 16 - 0
roles/service-gogs/tasks/gogs.yml

@@ -16,6 +16,22 @@
     createhome: yes
     state: present
 
+- name: Ensure gogs ssh dir exists
+  file:
+    dest: "{{ gogs_home }}/.ssh"
+    state: directory
+    mode: 0700
+    owner: "{{ gogs_user }}"
+    group: "{{ gogs_group }}"
+
+- name: Ensure gogs ssh key is up to date
+  copy:
+    content: "{{ wiki_git_private_key }}"
+    dest: "{{ gogs_home }}/.ssh/id_rsa"
+    mode: 0600
+    owner: "{{ gogs_user }}"
+    group: "{{ gogs_group }}"
+
 - name: gogs prereqs
   become: yes
   apt: name={{item}} state=present update_cache=yes cache_valid_time=86400