--- - 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