aboutsummaryrefslogtreecommitdiff
path: root/roles/gitea/tasks/secrets.yml
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2021-10-09 19:04:39 +0200
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2021-10-09 19:04:39 +0200
commite920a10a5c15b53683ee5caff122ec9378032cd5 (patch)
treec51dd14cfad71c8c543c8ab2f43b54c227507ef9 /roles/gitea/tasks/secrets.yml
parente11720ab7511e32c8e9e62b94f6578703eac6c42 (diff)
downloadansible_collection-e920a10a5c15b53683ee5caff122ec9378032cd5.tar.gz
gitea: WIP
Diffstat (limited to 'roles/gitea/tasks/secrets.yml')
-rw-r--r--roles/gitea/tasks/secrets.yml36
1 files changed, 36 insertions, 0 deletions
diff --git a/roles/gitea/tasks/secrets.yml b/roles/gitea/tasks/secrets.yml
new file mode 100644
index 0000000..cde4dd8
--- /dev/null
+++ b/roles/gitea/tasks/secrets.yml
@@ -0,0 +1,36 @@
+---
+- name: Generate SECRET_KEY
+ command:
+ cmd: gitea generate secret SECRET_KEY
+ creates: /etc/gitea/secret_key
+ become_user: git
+ become: yes
+ register: gen_sec_key
+
+- name: Save secret Key
+ copy:
+ content: '{{ gen_sec_key.stdout }}'
+ dest: /etc/gitea/secret_key
+ owner: root
+ group: git
+ mode: '640'
+ become: yes
+ when: gen_sec_key.changed
+
+- name: Generate INTERNAL_TOKEN
+ command:
+ cmd: gitea generate secret INTERNAL_TOKEN
+ creates: /etc/gitea/internal_token
+ become_user: git
+ become: yes
+ register: gen_int_tok
+
+- name: Save INTERNAL_TOKEN
+ copy:
+ content: '{{ gen_int_tok.stdout }}'
+ dest: /etc/gitea/internal_token
+ owner: root
+ group: git
+ mode: '640'
+ become: yes
+ when: gen_int_tok.changed