{"id":381,"date":"2021-02-12T18:06:21","date_gmt":"2021-02-12T23:06:21","guid":{"rendered":"https:\/\/chasberndt.com\/?p=381"},"modified":"2021-02-12T18:09:56","modified_gmt":"2021-02-12T23:09:56","slug":"borked-website-a-short-story","status":"publish","type":"post","link":"https:\/\/chasberndt.com\/?p=381","title":{"rendered":"Borked Website: A Short Story"},"content":{"rendered":"\n<p>Today, I broke this website while testing some minor changes to the deployment scripts. I tried to figure out what went wrong (I messed up something with Apache while trying to renew the SSL cert). I couldn&#8217;t get it sorted out so I blew up the droplet (VM, EC2 instance, whatever) and re-executed the existing playbooks. What enabled me to do this? How was I able to do this?<\/p>\n\n\n\n<p><strong>Things that allowed me to recover:<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>These scripts include daily backups so even if the entire WordPress deployment needs to be re-created from scratch, the data is tarred up and ready to go.<\/li><li>The website data is not stored on the VM but an attached persistent volume.<\/li><li>The database is a standalone, managed MySQL instance.<\/li><li>Playbooks and roles are designed to be idempotent so re-running them is safe. They aim for <em>desired state<\/em> meaning no change if it&#8217;s not needed.<\/li><\/ol>\n\n\n\n<p><strong>How I recovered:<\/strong><\/p>\n\n\n\n<p>So I simply destroyed the droplet, recreated it, and re-provisioned it. I had to perform a few tasks manually in DigitalOcean (whitelisting the droplet IP to the MySQL instance and pointing the floating IP to the new droplet) but even these tasks <strong>can<\/strong> be automated in the future (and will be).<\/p>\n\n\n\n<p>All in all, I spent about an hour trying to figure out what I broke and another fifteen minutes to blow away and recreate the host. This is the way&#8230; Or at least, this is the way towards the way.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today, I broke this website while testing some minor changes to the deployment scripts. I tried to figure out what went wrong (I messed up something with Apache while trying to renew the SSL cert). I couldn&#8217;t get it sorted out so I blew up the droplet (VM, EC2 instance, whatever) and re-executed the existing <a class=\"read-more\" href=\"https:\/\/chasberndt.com\/?p=381\">&hellip;&nbsp;<span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[20,13,19],"tags":[],"class_list":["post-381","post","type-post","status-publish","format-standard","hentry","category-ansible","category-automation","category-cloud"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/chasberndt.com\/index.php?rest_route=\/wp\/v2\/posts\/381","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chasberndt.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chasberndt.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chasberndt.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chasberndt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=381"}],"version-history":[{"count":3,"href":"https:\/\/chasberndt.com\/index.php?rest_route=\/wp\/v2\/posts\/381\/revisions"}],"predecessor-version":[{"id":384,"href":"https:\/\/chasberndt.com\/index.php?rest_route=\/wp\/v2\/posts\/381\/revisions\/384"}],"wp:attachment":[{"href":"https:\/\/chasberndt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=381"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chasberndt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=381"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chasberndt.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=381"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}