Browse Source

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

Till Klocke 8 years ago
parent
commit
a9a04d29aa
1 changed files with 16 additions and 0 deletions
  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