Files
cloud-gitea/handlers/main.yml
T
lhahnandClaude Opus 5.5 126ab04bec Make admin creation upgrade-safe and drop deprecated avatar options
- "generate admin user" handler also fires on version upgrades; tolerate
  an existing admin and hide the password from logs (no_log)
- remove [picture] DISABLE_GRAVATAR / ENABLE_FEDERATED_AVATAR, which
  Gitea >= 1.23 ignores (moved to the admin panel)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 16:31:40 +02:00

24 lines
696 B
YAML
Executable File

---
- name: restart gitea
systemd:
name: gitea
state: restarted
- name: generate admin user
command:
cmd: |
{{ gitea_link }}/gitea admin user create
--admin
--username {{ gitea_admin_user }}
--password '{{ gitea_admin_pass }}'
--email {{ gitea_admin_mail }}
--config {{ gitea_home }}/app.ini
--work-path {{ gitea_data_location }}
become: yes
become_user: "{{ gitea_usr }}"
register: gitea_admin_create
# handler also fires on version upgrades; an existing admin is fine
failed_when: gitea_admin_create.rc != 0 and 'user already exists' not in gitea_admin_create.stderr
changed_when: gitea_admin_create.rc == 0
no_log: true