caktus / margarita

A collection of delicious Salt states for Django project deployments.
BSD 3-Clause "New" or "Revised" License
34 stars 8 forks source link

Updated Xenial Support PR #147

Closed vkurup closed 7 years ago

vkurup commented 7 years ago

This supercedes #138. I didn't want to hijack that one because I think some projects may be using it directly. I did, however, base my work off that PR so hopefully it will be easy for those projects to migrate once this is merged. Please review Victor's initial PR description in #138, and then some of the following comments which explain most of the changes that I made.

I have tested this branch with multiple deploys (over and over again), including the following scenarios:

Issues addressed:

For the upgrade of 14.04 or 12.04 projects, and for any projects currently using #138 directly, there will need to be minor changes made on the django-project-template side:

Once those changes are made, you'll need to run these commands:

fab staging setup_master
fab staging setup_minion:<INSERT CURRENT ROLES HERE> -H <MINION_IP>
# repeat the setup_minion call for each minion.
fab staging deploy

Link to the accompanying d-p-t PR: https://github.com/caktus/django-project-template/pull/280

Because projects will break if they don't do the steps above, I'd recommend bumping margarita's major version, once we decide that this is the correct approach.

vkurup commented 7 years ago

Thanks @dpoirier. This is updated now.

dpoirier commented 7 years ago

Just curious, what did having fail2ban monitor the auth and mail logs have to do with getting this working on Xenial?

vkurup commented 7 years ago

Hmm, good question. Those were in place when I started reviewing the PR and since it worked, I focused on getting the other pieces to work. :) @vrocha wrote "Some fail2ban specific nuances that sort of worked out"

vkurup commented 7 years ago

I refactored the IP extraction a bit. Could you take a look and see what you think? I haven't run any real deployment tests with this yet, so I'd like to do that after I get it looking correct.

dpoirier commented 7 years ago

@vkurup Looks good enough. Still kind of obscure, but it's salt. (fingerscrossed) that it still works.

vkurup commented 7 years ago

Reconfirmed that it still works in all 3 cases:

dpoirier commented 7 years ago

:mans_shoe: