{"id":258,"date":"2018-11-29T12:14:38","date_gmt":"2018-11-29T17:14:38","guid":{"rendered":"http:\/\/myblog.vindaloo.com\/?p=258"},"modified":"2018-11-29T12:57:41","modified_gmt":"2018-11-29T17:57:41","slug":"getting-started-with-ansible-et-al","status":"publish","type":"post","link":"http:\/\/myblog.vindaloo.com\/?p=258","title":{"rendered":"Getting started with Ansible, et al"},"content":{"rendered":"<p>For admins, young and old, getting started with orchestration tools like <a href=\"http:\/\/www.ansible.com\" target=\"_blank\" rel=\"noopener\">ansible<\/a>\u00a0I believe that the wise man&#8217;s first move is to create an orchestration workstation. This machine will have: <em>ansible, terraform, git, and\u00a0 your favorite editor<\/em>. You are going to use this machine as the basis for infrastructure as code for your organization for the short term future. Basically, you&#8217;ll stop using this machine for infrastructure as code once you get to the point where you can repeatably automate the creation and change management of things. At that point the role of this machine will be testing infrastructure changes. And there will be another machine exactly like this one that controls your <em>production<\/em> infrastructure.<\/p>\n<p>The first thing that this machine should be able to do is replicate itself. That&#8217;s a simple task. In Unix terms you are looking at a box that can:<\/p>\n<ul>\n<li style=\"text-align: left;\">allows you to log in via ssh keys<\/li>\n<li style=\"text-align: left;\">allows you to edit the ansible and terraform configurations which<\/li>\n<li style=\"text-align: left;\">are stored in git so that they are version controlled<\/li>\n<\/ul>\n<p>That really specifies three users, <em>you, ansible,<\/em> and <em>terraform.<\/em>\u00a0Also, as specified before, you need a hand full of packages: ansible, git, and your favorite editor. The whole thing looks pretty similar to this:<\/p>\n<pre>chris $ mkdir Ansible\r\nchris $ git init Ansible\r\nchris $ cd Ansible\r\nchris $ mkdir -p files\/global group_vars host_vars roles\/dot.template\/{defaults,files,handlers,tasks,templates,tests}\r\nchris $ find * -type d -exec touch {}\/Readme.md \\;\r\nchris $ touch Readme.md\r\nchris $ git add . &amp;&amp; git commit -m 'Initial revision.'<\/pre>\n<p>That builds an ansible configuration as a git repository and checks in the first revision. It also populates the ansible repository with directories that\u00a0 roughly correspond to ansible best practices. This will be a working repository which you are going to build out to support your infrastructure. You&#8217;ll do this by adding inventory, playbooks and roles bespoke to your needs.<\/p>\n<p><a href=\"http:\/\/myblog.vindaloo.com\/?p=260\"><em>More on this later.<\/em><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>For admins, young and old, getting started with orchestration tools like ansible\u00a0I believe that the wise man&#8217;s first move is to create an orchestration workstation. This machine will have: ansible, terraform, git, and\u00a0 your favorite editor. You are going to use this machine as the basis for infrastructure as code for your organization for the &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/myblog.vindaloo.com\/?p=258\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Getting started with Ansible, et al&#8221;<\/span><\/a><\/p>\n","protected":false},"author":54,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-258","post","type-post","status-publish","format-standard","hentry","category-ansible"],"_links":{"self":[{"href":"http:\/\/myblog.vindaloo.com\/index.php?rest_route=\/wp\/v2\/posts\/258","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/myblog.vindaloo.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/myblog.vindaloo.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/myblog.vindaloo.com\/index.php?rest_route=\/wp\/v2\/users\/54"}],"replies":[{"embeddable":true,"href":"http:\/\/myblog.vindaloo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=258"}],"version-history":[{"count":3,"href":"http:\/\/myblog.vindaloo.com\/index.php?rest_route=\/wp\/v2\/posts\/258\/revisions"}],"predecessor-version":[{"id":264,"href":"http:\/\/myblog.vindaloo.com\/index.php?rest_route=\/wp\/v2\/posts\/258\/revisions\/264"}],"wp:attachment":[{"href":"http:\/\/myblog.vindaloo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=258"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/myblog.vindaloo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=258"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/myblog.vindaloo.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=258"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}