Use handler so that we actually have a users table when we go to add the admin

This commit is contained in:
Salt 2020-04-30 05:59:10 -05:00
parent 35138d98e1
commit 181f8835e2
2 changed files with 20 additions and 14 deletions

View File

@ -0,0 +1,19 @@
#!/usr/bin/ansible-playbook
# vim:ft=ansible:
---
- name: Create 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
become: yes
become_user: git

View File

@ -87,21 +87,8 @@
mode: "0640" mode: "0640"
owner: "root" owner: "root"
group: "git" group: "git"
- name: Create 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
become_user: git become_user: git
notify: gitea add default user
when: not p.stat.exists when: not p.stat.exists
- name: Template out service - name: Template out service
template: template: