ansible/roles/gitea/handlers/main.yml

37 lines
863 B
YAML
Raw Normal View History

#!/usr/bin/ansible-playbook
# vim:ft=ansible:
---
2020-04-30 06:45:04 -05:00
- name: restart gitea
service:
name: gitea.service
state: restarted
2020-04-30 06:05:54 -05:00
- name: gitea add default user
block:
2020-04-30 08:11:03 -05:00
- name: Create user
2020-04-30 08:11:33 -05:00
command:
argv:
- /usr/local/bin/gitea
- admin
- create-user
- --username
- "{{ gitea_admin_username }}"
- --password
- "{{ gitea_admin_password }}"
- --email
- "{{ gitea_admin_email }}"
- --config
- /etc/gitea/app.ini
2020-04-30 08:11:03 -05:00
- name: Promote user to admin
2020-04-30 08:16:59 -05:00
command:
argv:
- /usr/bin/mysql
- gitea
- -u
- gitea
- -p
- "{{ gitea_mysql_password }}"
- -e
- 'UPDATE user SET is_admin = 1 WHERE name = {{ gitea_admin_username }};'
become: yes
become_user: git