2020-04-30 11:54:27 -05:00
|
|
|
|
|
|
|
#!/usr/bin/ansible-playbook
|
|
|
|
# vim:ft=ansible:
|
|
|
|
---
|
|
|
|
- name: Create user
|
|
|
|
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
|
|
|
|
become: yes
|
|
|
|
become_user: git
|
|
|
|
- name: Promote user to admin
|
|
|
|
command:
|
|
|
|
argv:
|
|
|
|
- /usr/bin/mysql
|
|
|
|
- gitea
|
|
|
|
- -u
|
|
|
|
- gitea
|
|
|
|
- -p
|
|
|
|
- "{{ gitea_mysql_password }}"
|
|
|
|
- -e
|
2020-04-30 12:08:21 -05:00
|
|
|
- 'UPDATE user SET is_admin = 1 WHERE name = "{{ gitea_admin_username }}";'
|
2020-04-30 11:54:27 -05:00
|
|
|
become: yes
|
|
|
|
become_user: git
|