diff --git a/roles/gitea/tasks/main.yml b/roles/gitea/tasks/main.yml index 57a6bba..43d9063 100644 --- a/roles/gitea/tasks/main.yml +++ b/roles/gitea/tasks/main.yml @@ -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