--- - name: "load docker, db and proxy for {{ application_id }}" include_role: name: sys-stk-full-stateful vars: docker_compose_flush_handlers: false - name: "Deploy MediaWiki LocalSettings.php" template: src: "LocalSettings.php.j2" dest: "{{ MEDIAWIKI_SETTINGS_HOST_PATH }}" mode: '0644' - name: "Flush docker compose handlers" meta: flush_handlers - name: "Create MediaWiki admin user" command: > docker exec -u {{ MEDIAWIKI_USER }} {{ MEDIAWIKI_CONTAINER }} php /var/www/html/maintenance/createAndPromote.php --bureaucrat --sysop {{ MEDIAWIKI_ADMINISTRATOR_NAME }} {{ MEDIAWIKI_ADMINISTRATOR_PASSWORD }} {{ MEDIAWIKI_ADMINISTRATOR_EMAIL }} register: create_admin changed_when: > 'created' in (create_admin.stdout | default('')) or 'Created' in (create_admin.stdout | default('')) failed_when: > create_admin.rc != 0 and ('already exists' not in (create_admin.stdout | default('') ~ create_admin.stderr | default('')))