You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.3 KiB
46 lines
1.3 KiB
---
|
|
- import_tasks: ../includes/webapps_set_install_mode.yml
|
|
vars:
|
|
- root_dir: "{{ gitea_root_dir }}"
|
|
- version: "{{ gitea_version }}"
|
|
tags: gitea
|
|
- set_fact: gitea_install_mode={{ (install_mode == 'upgrade' and not gitea_manage_upgrade) | ternary('none',install_mode) }}
|
|
tags: gitea
|
|
- set_fact: gitea_current_version={{ current_version | default('') }}
|
|
tags: gitea
|
|
|
|
- import_tasks: ../includes/get_rand_pass.yml
|
|
vars:
|
|
- pass_file: "{{ gitea_root_dir }}/meta/ansible_key"
|
|
tags: gitea
|
|
- set_fact: gitea_key={{ rand_pass }}
|
|
tags: gitea
|
|
|
|
- import_tasks: ../includes/get_rand_pass.yml
|
|
vars:
|
|
- pass_file: "{{ gitea_root_dir }}/meta/ansible_dbpass"
|
|
when: gitea_db_pass is not defined
|
|
tags: gitea
|
|
- set_fact: gitea_db_pass={{ rand_pass }}
|
|
when: gitea_db_pass is not defined
|
|
tags: gitea
|
|
|
|
- name: Create random tokens
|
|
shell: "{{ gitea_root_dir }}/bin/gitea generate secret {{ item }} > {{ gitea_root_dir }}/meta/ansible_{{ item }}"
|
|
args:
|
|
creates: "{{ gitea_root_dir }}/meta/ansible_{{ item }}"
|
|
with_items:
|
|
- INTERNAL_TOKEN
|
|
- LFS_JWT_SECRET
|
|
- SECRET_KEY
|
|
tags: gitea
|
|
|
|
- name: Read random tokens
|
|
command: cat {{ gitea_root_dir }}/meta/ansible_{{ item }}
|
|
with_items:
|
|
- INTERNAL_TOKEN
|
|
- LFS_JWT_SECRET
|
|
- SECRET_KEY
|
|
changed_when: False
|
|
register: gitea_tokens
|
|
tags: gitea
|
|
|