Use MySQL query to promote new user to admin
Because that doesn't happen by default
This commit is contained in:
parent
bd38470bde
commit
0d8f6f4a97
@ -6,18 +6,28 @@
|
||||
name: gitea.service
|
||||
state: restarted
|
||||
- name: gitea add default 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
|
||||
block:
|
||||
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
|
||||
name: Promote user to admin
|
||||
mysql_query:
|
||||
login_db: gitea
|
||||
login_user: gitea
|
||||
login_password: {{ gitea_mysql_password }}
|
||||
query: UPDATE user SET is_admin = 1 WHERE name = %s
|
||||
positional_args:
|
||||
- "{{ gitea_admin_username }}"
|
||||
become: yes
|
||||
become_user: git
|
||||
|
@ -10,6 +10,7 @@
|
||||
packages:
|
||||
- mariadb-server
|
||||
- python3-mysqldb
|
||||
- python3-pymysql
|
||||
- name: Start MySQL
|
||||
service:
|
||||
name: mysql
|
||||
|
Loading…
Reference in New Issue
Block a user