Ansible able to migrate database on upgrade#138
Conversation
|
I had a merge conflict with the config.py file that turned in to a 3 way merge conflict that turned into the whole thing replaying its commits on top of itself. Sorry about that... |
ops/ansible/ansible_upgrade.sh
Outdated
| @@ -0,0 +1,3 @@ | |||
| #!/bin/bash | |||
| pip install ansible | |||
There was a problem hiding this comment.
@thatarchguy, is there any reason you don't have the --upgrade flag on here, but you do in ansible_install.sh? Maybe we can ensure that a minimum version is installed (i.e. 2.0+)
There was a problem hiding this comment.
I overlooked that. I have the --upgrade ansible setuptools in the install.sh script because ansible throws errors if you don't pip install setuptools after you install it from apt. It's weird I know.
And yeah we want ansible to be 2.0+ for sure.
|
@thatarchguy, Maybe we should just have one command that has the logic to determine what state it's in. For instance, if the alembic table does not exist and |
|
Yeah I looked into this a lot and I couldn't figure out how to test if the tables existed or not in alembic. There were a few issues on stackoverflow and mailing lists with people in similar situations as ours. This two command thing was a compromise |
|
@thatarchguy, I don't think you need to read the data in the alembic table. You just need to something like: Edit: |
Ansible now migrates database on upgrade Signed-off-by: Kevin <kevin@stealsyour.pw>
d1fdd5c to
008215d
Compare
Sets the minimum version of Ansible to use at 2.0.0.1 so it doesn't automatically upgrade a system's Ansible if it isn't necessary Formatting fixes
008215d to
725d5ca
Compare
|
@thatarchguy really nice job on this. I think my last commit addresses our issues. I'm ready to merge this if you are. |
|
Lgtm! Merge at will |
A few issues in one here:
Ansible is able to perform database migrations on upgrade - #125
We now track migrations in the repository - #129
A special command was created for users that already have the virtual_* tables in their database. (People who already installed a mailserver prior to PostMaster)
python manage.py existingdb