mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-12-05 09:18:53 +00:00
refactor(web-app-mastodon): give the Mastodon administrator the platform administrator's identity
The administrator tasks created, unblocked, approved and converged the
account of the host administrator and gave it the host's sudo password;
the role had no web login with that credential before the design pass
added the converger. tasks/05_administrator.yml now reads
lookup('users', 'platform_administrator') for all four steps, and
templates/playwright.env.j2 hands the platform administrator's e-mail,
username and password to the specs. meta/users.yml declares the user,
identical to feature/store-i18n, so the identity lines merge without a
conflict there.
Statically checked only (YAML keys, user lookups, comment policy); the
first live run is the verification on the merged state.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
904a3ff49e
commit
6b3ca938dd
3 files changed
+10
-8
No files matched your search
@@ -0,0 +1,2 @@
|
||||
---
|
||||
platform_administrator: {}
|
||||
@@ -2,7 +2,7 @@
|
||||
- name: 🧹 Unblock the administrator username
|
||||
ansible.builtin.shell: > # nocheck: container-exec-resolver runtime-resolved CID, delegated to the hosting node
|
||||
container exec -i -u root
|
||||
-e MASTODON_ADMIN_USERNAME={{ lookup('users', 'administrator').username | quote }}
|
||||
-e MASTODON_ADMIN_USERNAME={{ lookup('users', 'platform_administrator').username | quote }}
|
||||
{{ MASTODON_LOCAL_CID | quote }}
|
||||
bundle exec rails runner -
|
||||
args:
|
||||
@@ -14,7 +14,7 @@
|
||||
set -o pipefail
|
||||
# nocheck: container-exec-resolver runtime-resolved CID, delegated to the hosting node
|
||||
container exec -u root {{ MASTODON_LOCAL_CID | quote }} bash -c \
|
||||
"bin/tootctl accounts create {{ lookup('users', 'administrator').username }} --email {{ lookup('users', 'administrator').email }} --confirmed --role Owner" 2>&1 \
|
||||
"bin/tootctl accounts create {{ lookup('users', 'platform_administrator').username }} --email {{ lookup('users', 'platform_administrator').email }} --confirmed --role Owner" 2>&1 \
|
||||
| sed -e '/^New password:/d'
|
||||
args:
|
||||
executable: /bin/bash
|
||||
@@ -36,7 +36,7 @@
|
||||
- exec
|
||||
- -i
|
||||
- -e
|
||||
- "MASTODON_ADMIN_USERNAME={{ lookup('users', 'administrator').username }}"
|
||||
- "MASTODON_ADMIN_USERNAME={{ lookup('users', 'platform_administrator').username }}"
|
||||
- -e
|
||||
- MASTODON_ADMIN_PASSWORD
|
||||
- "{{ MASTODON_LOCAL_CID }}" # nocheck: container-exec-resolver runtime-resolved CID, delegated to the hosting node
|
||||
@@ -47,7 +47,7 @@
|
||||
- "-"
|
||||
stdin: "{{ lookup('file', 'ruby/admin_password.rb') }}"
|
||||
environment:
|
||||
MASTODON_ADMIN_PASSWORD: "{{ lookup('users', 'administrator').password }}"
|
||||
MASTODON_ADMIN_PASSWORD: "{{ lookup('users', 'platform_administrator').password }}"
|
||||
register: mastodon_admin_password
|
||||
no_log: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}"
|
||||
changed_when: "'PASSWORD_CHANGED' in mastodon_admin_password.stdout"
|
||||
@@ -56,7 +56,7 @@
|
||||
or ('PASSWORD_CHANGED' not in mastodon_admin_password.stdout and 'PASSWORD_UNCHANGED' not in mastodon_admin_password.stdout)
|
||||
- name: 👍 Approve the administrator account in Mastodon
|
||||
ansible.builtin.shell: > # nocheck: container-exec-resolver runtime-resolved CID, delegated to the hosting node
|
||||
container exec -u root {{ MASTODON_LOCAL_CID | quote }} bash -c "bin/tootctl accounts modify {{ lookup('users', 'administrator').username }} --approve"
|
||||
container exec -u root {{ MASTODON_LOCAL_CID | quote }} bash -c "bin/tootctl accounts modify {{ lookup('users', 'platform_administrator').username }} --approve"
|
||||
register: tootctl_approve
|
||||
changed_when: false
|
||||
# rationale: async; approvals run overlapped, reaped below before the login spec
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
ADMIN_EMAIL={{ lookup('users', 'administrator').email | dotenv_quote }}
|
||||
ADMIN_EMAIL={{ lookup('users', 'platform_administrator').email | dotenv_quote }}
|
||||
|
||||
ADMIN_PASSWORD={{ lookup('users', 'administrator').password | dotenv_quote }}
|
||||
ADMIN_PASSWORD={{ lookup('users', 'platform_administrator').password | dotenv_quote }}
|
||||
|
||||
ADMIN_USERNAME={{ lookup('users', 'administrator').username | dotenv_quote }}
|
||||
ADMIN_USERNAME={{ lookup('users', 'platform_administrator').username | dotenv_quote }}
|
||||
|
||||
APP_BASE_URL={{ lookup('tls', application_id, 'url.base') | dotenv_quote }}
|
||||
|
||||
|
||||
Reference in new issue
Block a user