{"id":298,"date":"2020-04-29T21:04:04","date_gmt":"2020-04-30T01:04:04","guid":{"rendered":"https:\/\/chasberndt.com\/?p=298"},"modified":"2020-04-29T21:04:04","modified_gmt":"2020-04-30T01:04:04","slug":"re-architecting-this-website-iv","status":"publish","type":"post","link":"https:\/\/chasberndt.com\/?p=298","title":{"rendered":"Re-Architecting This Website IV"},"content":{"rendered":"\n<p><em>&#8220;Biting off more than I can chew.&#8221;<\/em><\/p>\n\n\n\n<p>As of Sunday, I had gotten droplet creation, volume storage, and a good bit of the base OS setup work handled. The major missing piece was the creating the database. I am happy to say that work is now complete, but it&#8217;s not without bumps, warts, and bruises. <\/p>\n\n\n\n<p>Creating the database server proved daunting because Ansible modules do not exist for DigitalOcean&#8217;s managed database server. I thought I&#8217;d just write a module or two, however that proved to be a much more daunting task than I first realized. <\/p>\n\n\n\n<p>I&#8217;ve never written a module for Ansible, I&#8217;m no DBA, and the number of APIs exposed for database actions left me feeling deflated. Still, I soldiered through and created a Python script I can use to create, configure, or destroy a managed MySQL server. There are a ton of assumptions made to keep the scope of work reduced, but it&#8217;s sufficient for my needs at this point.  It&#8217;s wrapped with argparse so I can run it from an Ansible command task then parse the JSON output.<\/p>\n\n\n\n<p>Check it out here: <a href=\"https:\/\/github.com\/seaburr\/WordPressOnDigitalOcean\/blob\/master\/roles\/database-server\/files\/digital_ocean_database.py\">https:\/\/github.com\/seaburr\/WordPressOnDigitalOcean\/blob\/master\/roles\/database-server\/files\/digital_ocean_database.py<\/a><\/p>\n\n\n\n<p>As I said, I believe Ansible modules should exist for their managed database, as they do for AWS and GCP however, I think that&#8217;s a larger project than one individual can tackle on their first attempt writing modules. I&#8217;d be happy to collaborate on that if it ever comes up.<\/p>\n\n\n\n<p>In related news, I&#8217;ve also extended the install-wordpress role to create a wp-config.php from template, including fetching unique salts from wordpress.org, I&#8217;ve also fixed a few small issues with the Apache installation and added missing packages.<\/p>\n\n\n\n<p>At this point, the only thing missing to go from nothing to a functioning WordPress site is adding database connection information into wp-config.php and handling SSL.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;Biting off more than I can chew.&#8221; As of Sunday, I had gotten droplet creation, volume storage, and a good bit of the base OS setup work handled. The major missing piece was the creating the database. I am happy to say that work is now complete, but it&#8217;s not without bumps, warts, and bruises. <a class=\"read-more\" href=\"https:\/\/chasberndt.com\/?p=298\">&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-298","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\/298","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=298"}],"version-history":[{"count":1,"href":"https:\/\/chasberndt.com\/index.php?rest_route=\/wp\/v2\/posts\/298\/revisions"}],"predecessor-version":[{"id":299,"href":"https:\/\/chasberndt.com\/index.php?rest_route=\/wp\/v2\/posts\/298\/revisions\/299"}],"wp:attachment":[{"href":"https:\/\/chasberndt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=298"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chasberndt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=298"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chasberndt.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=298"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}