2021-02-10 20:04:13 +01:00
|
|
|
---
|
2022-09-29 23:09:19 +02:00
|
|
|
- name: Generate OAuth2 JWT_SECRET if not provided
|
2021-02-10 20:04:13 +01:00
|
|
|
become: true
|
2023-01-27 01:35:16 +01:00
|
|
|
ansible.builtin.shell: 'umask 077; {{ gitea_full_executable_path }} generate secret JWT_SECRET > {{ gitea_configuraion_path }}/gitea_oauth_jwt_secret'
|
2021-02-10 20:04:13 +01:00
|
|
|
args:
|
2022-08-22 13:33:20 +02:00
|
|
|
creates: '{{ gitea_configuraion_path }}/gitea_oauth_jwt_secret'
|
2021-02-10 20:04:13 +01:00
|
|
|
when: gitea_oauth2_jwt_secret | length == 0
|
|
|
|
|
2022-09-29 23:09:19 +02:00
|
|
|
- name: Read OAuth2 JWT_SECRET from file
|
2021-02-10 20:04:13 +01:00
|
|
|
become: true
|
2021-03-22 21:28:51 +01:00
|
|
|
ansible.builtin.slurp:
|
2022-08-22 13:33:20 +02:00
|
|
|
src: '{{ gitea_configuraion_path }}/gitea_oauth_jwt_secret'
|
2021-02-10 20:04:13 +01:00
|
|
|
register: oauth_jwt_secret
|
|
|
|
when: gitea_oauth2_jwt_secret | length == 0
|
|
|
|
|
2022-09-29 23:09:19 +02:00
|
|
|
- name: Set fact gitea_oauth2_jwt_secret
|
2021-03-22 21:28:51 +01:00
|
|
|
ansible.builtin.set_fact:
|
2021-02-10 20:04:13 +01:00
|
|
|
gitea_oauth2_jwt_secret: "{{ oauth_jwt_secret['content'] | b64decode }}"
|
|
|
|
when: gitea_oauth2_jwt_secret | length == 0
|
|
|
|
|
2022-09-29 23:09:19 +02:00
|
|
|
- name: Generate LFS JWT_SECRET if not provided
|
2021-02-10 20:04:13 +01:00
|
|
|
become: true
|
2023-01-27 01:35:16 +01:00
|
|
|
ansible.builtin.shell: 'umask 077; {{ gitea_full_executable_path }} generate secret JWT_SECRET > {{ gitea_configuraion_path }}/gitea_lfs_jwt_secret'
|
2021-02-10 20:04:13 +01:00
|
|
|
args:
|
2022-08-22 13:33:20 +02:00
|
|
|
creates: '{{ gitea_configuraion_path }}/gitea_lfs_jwt_secret'
|
2021-02-10 20:04:13 +01:00
|
|
|
when: gitea_lfs_jwt_secret | length == 0
|
|
|
|
|
2022-09-29 23:09:19 +02:00
|
|
|
- name: Read LFS JWT_SECRET from file
|
2021-02-10 20:04:13 +01:00
|
|
|
become: true
|
2021-03-22 21:28:51 +01:00
|
|
|
ansible.builtin.slurp:
|
2022-08-22 13:33:20 +02:00
|
|
|
src: '{{ gitea_configuraion_path }}/gitea_lfs_jwt_secret'
|
2021-02-10 20:04:13 +01:00
|
|
|
register: lfs_jwt_secret
|
|
|
|
when: gitea_lfs_jwt_secret | length == 0
|
|
|
|
|
2022-09-29 23:09:19 +02:00
|
|
|
- name: Set fact gitea_lfs_jwt_secret
|
2021-03-22 21:28:51 +01:00
|
|
|
ansible.builtin.set_fact:
|
2021-02-10 20:04:13 +01:00
|
|
|
gitea_lfs_jwt_secret: "{{ lfs_jwt_secret['content'] | b64decode }}"
|
|
|
|
when: gitea_lfs_jwt_secret | length == 0
|