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,15 +70,21 @@
owner: "root"
group: "git"
path: "/etc/gitea"
- name: Generate INTERNAL_TOKEN"
command: /usr/local/bin/gitea generate secret INTERNAL_TOKEN
register: gitea_internal_token
- name: Generate SECRET_KEY"
command: /usr/local/bin/gitea generate secret SECRET_KEY
register: gitea_secret_key
- name: Template out app.ini
template:
src: "app.ini"
dest: "/etc/gitea/app.ini"
mode: "0640"
- name: Check for config
stat: path="/etc/gitea/app.ini"
register: p
- name: Deploy config
block:
- name: Generate INTERNAL_TOKEN"
command: /usr/local/bin/gitea generate secret INTERNAL_TOKEN
register: gitea_internal_token
- name: Generate SECRET_KEY"
command: /usr/local/bin/gitea generate secret SECRET_KEY
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