Save admin password in credentials
This commit is contained in:
parent
a4e2957b19
commit
5eb228c279
1 changed files with 16 additions and 5 deletions
|
@ -149,12 +149,23 @@
|
|||
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 compose exec -it mastodon_web bash -c 'RAILS_ENV=production tootctl accounts create {{ admin_name }} --email {{ admin_email }} --confirmed --role Owner'"
|
||||
args:
|
||||
chdir: /srv/mastodon
|
||||
when: accountcount.stdout == "1"
|
||||
- name: register a mastodon admin account
|
||||
block:
|
||||
|
||||
- name: create admin account
|
||||
shell: "docker compose exec -it mastodon_web bash -c 'RAILS_ENV=production tootctl accounts create {{ admin_name }} --email {{ admin_email }} --confirmed --role Owner' 2>&1 | grep \"New password: \" | sed -e 's/.*password: //'"
|
||||
args:
|
||||
chdir: /srv/mastodon
|
||||
register: passwdout
|
||||
|
||||
- name: save masto admin password
|
||||
delegate_to: localhost
|
||||
become: false
|
||||
copy:
|
||||
dest: credentials/mastodon/masto_admin_pw
|
||||
content: "{{passwdout.stdout}}"
|
||||
|
||||
when: accountcount.stdout == "1"
|
||||
|
||||
- name: restart mastodon
|
||||
command: docker compose restart
|
||||
|
|
Loading…
Reference in a new issue