Only deploy Gitea config if we don't already have one

This commit is contained in:
Salt 2020-04-30 05:08:52 -05:00
parent 31ea3c3e1f
commit a80d0fa1c4

View File

@ -70,6 +70,11 @@
owner: "root" owner: "root"
group: "git" group: "git"
path: "/etc/gitea" path: "/etc/gitea"
- name: Check for config
stat: path="/etc/gitea/app.ini"
register: p
- name: Deploy config
block:
- name: Generate INTERNAL_TOKEN" - name: Generate INTERNAL_TOKEN"
command: /usr/local/bin/gitea generate secret INTERNAL_TOKEN command: /usr/local/bin/gitea generate secret INTERNAL_TOKEN
register: gitea_internal_token register: gitea_internal_token
@ -81,4 +86,5 @@
src: "app.ini" src: "app.ini"
dest: "/etc/gitea/app.ini" dest: "/etc/gitea/app.ini"
mode: "0640" mode: "0640"
when: not p.stat.exists
become: yes become: yes