Use MySQL query to promote new user to admin

Because that doesn't happen by default
This commit is contained in:
Salt 2020-04-30 07:56:36 -05:00
parent bd38470bde
commit 0d8f6f4a97
2 changed files with 24 additions and 13 deletions

View File

@ -6,6 +6,8 @@
name: gitea.service
state: restarted
- name: gitea add default user
block:
name: Create user
command:
argv:
- /usr/local/bin/gitea
@ -19,5 +21,13 @@
- "{{ 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

View File

@ -10,6 +10,7 @@
packages:
- mariadb-server
- python3-mysqldb
- python3-pymysql
- name: Start MySQL
service:
name: mysql