Fix not including tasks to add user

This commit is contained in:
Salt 2020-04-30 13:08:15 -05:00
parent 30bed76efe
commit 988246ac66
2 changed files with 27 additions and 28 deletions

View File

@ -7,4 +7,4 @@
name: gitea.service name: gitea.service
state: restarted state: restarted
- name: gitea add default user - name: gitea add default user
import_tasks: tasks/add_default_user.yml include_tasks: tasks/add_default_user.yml

View File

@ -2,32 +2,31 @@
#!/usr/bin/ansible-playbook #!/usr/bin/ansible-playbook
# vim:ft=ansible: # vim:ft=ansible:
--- ---
- name: Create user - block:
command: - name: Create user
argv: command:
- /usr/local/bin/gitea argv:
- admin - /usr/local/bin/gitea
- create-user - admin
- --username - create-user
- "{{ gitea_admin_username }}" - --username
- --password - "{{ gitea_admin_username }}"
- "{{ gitea_admin_password }}" - --password
- --email - "{{ gitea_admin_password }}"
- "{{ gitea_admin_email }}" - --email
- --config - "{{ gitea_admin_email }}"
- /etc/gitea/app.ini - --config
become: yes - /etc/gitea/app.ini
become_user: git - name: Promote user to admin
- name: Promote user to admin command:
command: argv:
argv: - /usr/bin/mysql
- /usr/bin/mysql - gitea
- gitea - -u
- -u - gitea
- gitea - -p
- -p - "{{ gitea_mysql_password }}"
- "{{ gitea_mysql_password }}" - -e
- -e - 'UPDATE user SET is_admin = 1 WHERE name = "{{ gitea_admin_username }}";'
- 'UPDATE user SET is_admin = 1 WHERE name = "{{ gitea_admin_username }}";'
become: yes become: yes
become_user: git become_user: git