Explorar el Código

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

Till Klocke hace 10 años
padre
commit
a9a04d29aa
Se han modificado 1 ficheros con 16 adiciones y 0 borrados
  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