Create default admin user on startup

This commit is contained in:
Salt 2020-04-30 05:25:35 -05:00
parent bdb50afcc0
commit 2f432feb24
2 changed files with 20 additions and 1 deletions

View File

@ -31,6 +31,15 @@
3933353234613430373930663832643934613233383635613433
gitea_url: "git.9iron.club"
gitea_webroot: "/var/www/gitea"
gitea_admin_name: "salt"
gitea_admin_email: "rehashedsalt@cock.li"
gitea_admin_password: !vault |
$ANSIBLE_VAULT;1.1;AES256
35613039646236306236363930353231303331633765303039373736626666666530323433356466
3062633166313332643039613561303431613735396339650a376664373137643439303465376365
35313266376539366134343562626164616666306338343538663361393964626565303331383234
3565646664333966650a323530356664366262653763363439613534303764366436376634373639
62303264653836656162366362316461656363353539343632616462626231643632
- hosts: tag_minecraft_ultreload
roles:
- role: minecraft

View File

@ -52,7 +52,6 @@
- name: Create directory structure
file:
state: directory
recurse: yes
owner: git
group: git
mode: "0750"
@ -86,5 +85,16 @@
src: "app.ini"
dest: "/etc/gitea/app.ini"
mode: "0640"
- name: Create default user
command: /usr/local/bin/gitea admin create-user --username {{ gitea_admin_username }} --password {{ gitea_admin_password }} --email {{ gitea_admin_email }}
when: not p.stat.exists
- name: Template out service
template:
src: "gitea.service"
dest: "/etc/systemd/system/gitea.service"
- name: Start and enable service
service:
name: "gitea.service"
enabled: yes
state: "started"
become: yes