Only deploy Gitea config if we don't already have one
This commit is contained in:
parent
31ea3c3e1f
commit
a80d0fa1c4
@ -70,15 +70,21 @@
|
|||||||
owner: "root"
|
owner: "root"
|
||||||
group: "git"
|
group: "git"
|
||||||
path: "/etc/gitea"
|
path: "/etc/gitea"
|
||||||
- name: Generate INTERNAL_TOKEN"
|
- name: Check for config
|
||||||
command: /usr/local/bin/gitea generate secret INTERNAL_TOKEN
|
stat: path="/etc/gitea/app.ini"
|
||||||
register: gitea_internal_token
|
register: p
|
||||||
- name: Generate SECRET_KEY"
|
- name: Deploy config
|
||||||
command: /usr/local/bin/gitea generate secret SECRET_KEY
|
block:
|
||||||
register: gitea_secret_key
|
- name: Generate INTERNAL_TOKEN"
|
||||||
- name: Template out app.ini
|
command: /usr/local/bin/gitea generate secret INTERNAL_TOKEN
|
||||||
template:
|
register: gitea_internal_token
|
||||||
src: "app.ini"
|
- name: Generate SECRET_KEY"
|
||||||
dest: "/etc/gitea/app.ini"
|
command: /usr/local/bin/gitea generate secret SECRET_KEY
|
||||||
mode: "0640"
|
register: gitea_secret_key
|
||||||
|
- name: Template out app.ini
|
||||||
|
template:
|
||||||
|
src: "app.ini"
|
||||||
|
dest: "/etc/gitea/app.ini"
|
||||||
|
mode: "0640"
|
||||||
|
when: not p.stat.exists
|
||||||
become: yes
|
become: yes
|
||||||
|
Loading…
Reference in New Issue
Block a user