Repository navigation
Ansible: migrate an empty database with -fresh - #352
Merged
Merged
Conversation
On a new deployment the playbook ran a plain migrate, which applies the seed migrations and installs Datopian's organisation, people, projects and repositories into somebody else's database. The role now counts the applied migrations first and passes -fresh when there are none. migrate_on_empty_database (default fresh; 'seed' keeps the old behaviour) decides what an empty database gets. A database with any migration applied is migrated exactly as before, so existing deployments are unaffected. Only a missing schema_migrations table or a zero count reads as empty; any other psql failure falls through to the plain migrate, and -fresh itself refuses a populated database. Checked: ansible-playbook --syntax-check on site.yml, and the decision tasks run locally against five simulated psql results (no table, zero rows, 89 applied, connection failure, seed mode). getting-started: drop the --skip-tags workaround; step 4 is just wg-init.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the new-install gap documented in #350: the playbook's plain migrate seeded Datopian's records into a fresh database.
control_apirole counts applied migrations; zero (or noschema_migrationstable) →wg-migrate -fresh.migrate_on_empty_database: fresh;seedkeeps the old behaviour.Tests and evidence
ansible-playbook --syntax-check site.ymlpasses.Security and permission impact
Reduces disclosure risk: a new deployment no longer receives Datopian's people and client records. No new permissions. No bead (no local Beads DB).