ansible/roles/gitea/tasks/add_default_user.yml

33 lines
745 B
YAML
Raw Normal View History

#!/usr/bin/ansible-playbook
# vim:ft=ansible:
---
2020-04-30 13:08:15 -05:00
- block:
- name: Create user
command:
argv:
- /usr/local/bin/gitea
- admin
- create-user
- --username
2020-08-02 19:39:39 -05:00
- "{{ gitea.admin.user }}"
2020-04-30 13:08:15 -05:00
- --password
2020-08-02 19:39:39 -05:00
- "{{ gitea.admin.pass }}"
2020-04-30 13:08:15 -05:00
- --email
2020-08-02 19:39:39 -05:00
- "{{ gitea.admin.email }}"
2020-04-30 13:08:15 -05:00
- --config
- /etc/gitea/app.ini
- name: Promote user to admin
command:
argv:
- /usr/bin/mysql
- gitea
- -u
- gitea
- -p
2020-08-02 19:39:39 -05:00
- "{{ gitea.mysql_password }}"
2020-04-30 13:08:15 -05:00
- -e
2020-08-02 19:39:39 -05:00
- 'UPDATE user SET is_admin = 1 WHERE name = "{{ gitea.admin.user }}";'
become: yes
become_user: git