Create admin account automatically
This commit is contained in:
parent
716d0f1dc8
commit
5124a8035f
1 changed files with 10 additions and 0 deletions
|
@ -137,6 +137,16 @@
|
|||
chdir: /srv/mastodon
|
||||
when: hazschema.stdout is match("Did not find any relations")
|
||||
|
||||
|
||||
- name: check whether our admin account has been created yet
|
||||
shell: "docker exec -t mastodon_db psql -U postgres mastodon_production -t -c 'select count(*) from accounts;' | awk '{ print $1 }' | head -1"
|
||||
register: accountcount
|
||||
|
||||
- name: create admin account
|
||||
command: "docker exec -it mastodon_web bash -c 'RAILS_ENV=production tootctl accounts create meat --email meat@{{ domain_name }} --confirmed --role Owner'"
|
||||
when: accountcount.stdout == "1"
|
||||
|
||||
|
||||
- name: restart mastodon
|
||||
command: docker compose restart
|
||||
args:
|
||||
|
|
Loading…
Reference in a new issue