3 ms·
I probably wasn't clear: 1. I am already using Ansible - but I want to run my "build from scratch" playbook every time I push a change instead of my "git pull
by andybak 10y ago
I probably wasn't clear:
1. I am already using Ansible - but I want to run my "build from scratch" playbook every time I push a change instead of my "git pull etc." playbook.
2. I'm not scared of losing data because of backups or similar - it's because I want to start from a clean droplet every time I push a change.
I do know in theory that playbooks are idempotent and running the 'build from scratch' playbook on a running instance should result in the same state as a genuine 'build from scratch' but there are many places this can fail:
1. Someone has inadvertently modified the environment at some point. A quick-fix or accidental change or an alteration in my playbook that isn't clearly reflected in the running instance
2. Not all ansible modules are perfectly idempotent. It's a fairly leaky abstraction.
3. If you never build from scratch apart from the first time then you're not really testing your automated deployment. The next time you really need to build from scratch you might get a shock.
- Jedd 10y ago> 1. Someone has inadvertently modified the environment at some point. > A quick-fix or accidental change or an alteration in my playbook that > isn't clearly reflected in the running instance This will cause you comparable problems whether you're building from scratch or upgrading in place (iff you're using a tool like ansible). As noted by another responder, you've got a human problem there, not necessarily a technical one. > 2. Not all ansible modules are perfectly idempotent. It's a > fairly leaky abstraction. I've not used ansible, but have used a few other tools, so I understand how this is (easily) possible. As in other cases, the trick, of course, is to fix this. ; ) > 3. If you never build from scratch apart from the first time then > you're not really testing your automated deployment. The next time > you really need to build from scratch you might get a shock. Totally agreed. Your original post suggested the problem you had was with transitory data - evidently your concern is more to do with the ability to consistently and reliably rebuild a known and trusted environment. Persistent block storage won't help you with that.
- andybak 10y agoWhat I was hoping it would do is enable me to use a single droplet but get a fast, minimal down-time 'from scratch' deployment that retains user data. The reason I want a single droplet is mainly cost. I use one droplet per client rather than a multitenant setup. I could use S3 and a separate hosted db but for various reasons I'd prefer not to.