{"id":25986,"date":"2016-04-01T14:32:39","date_gmt":"2016-04-01T12:32:39","guid":{"rendered":"https:\/\/mamchenkov.net\/wordpress\/?p=25986"},"modified":"2016-04-01T14:32:39","modified_gmt":"2016-04-01T12:32:39","slug":"first-attempt-at-ansible","status":"publish","type":"post","link":"https:\/\/mamchenkov.net\/wordpress\/2016\/04\/01\/first-attempt-at-ansible\/","title":{"rendered":"First attempt at Ansible"},"content":{"rendered":"<!-- google_ad_section_start -->\n<p>After all the <a href=\"https:\/\/mamchenkov.net\/wordpress\/2016\/04\/01\/checking-out-ansible-sorry-puppet\/\">reading about Ansible<\/a> that I&#8217;ve done yesterday, I woke up today with a strong will to try it out. \u00a0Running a few &#8220;<em>hello world<\/em>&#8221; examples wasn&#8217;t illustrative enough, so I decided to migrate my <a href=\"https:\/\/github.com\/mamchenkov\/dotfiles\">dotfiles repository<\/a> from Puppet to Ansible. \u00a0This would provide just enough complexity to try things out, without any danger of breaking things horribly.<\/p>\n<p>I&#8217;m proud to say that it took me only about two-three hours of trying things out to complete this task. \u00a0In the process, the following things were tried:<\/p>\n<ul>\n<li><a href=\"http:\/\/docs.ansible.com\/ansible\/playbooks_best_practices.html\">Ansible best practices<\/a><\/li>\n<li><a href=\"http:\/\/docs.ansible.com\/ansible\/playbooks.html\">Playbooks<\/a> (<em>site.yml<\/em>)<\/li>\n<li><a href=\"http:\/\/docs.ansible.com\/ansible\/playbooks_roles.html\">Roles<\/a> (dotfiles, fonts, vim, git)<\/li>\n<li>Tasks (file system operations, package installation, git repositories)<\/li>\n<li><a href=\"http:\/\/docs.ansible.com\/ansible\/playbooks_tags.html\">Tags<\/a> (I&#8217;m using files, packages, network)<\/li>\n<li><a href=\"http:\/\/docs.ansible.com\/ansible\/playbooks_loops.html\">Loops<\/a> (file globs, ad hoc items, pre-defined lists)<\/li>\n<li><a href=\"http:\/\/docs.ansible.com\/ansible\/playbooks_filters.html\">Filters<\/a> (basename is super handy)<\/li>\n<li><a href=\"http:\/\/docs.ansible.com\/ansible\/intro_inventory.html\">Inventories<\/a> (mostly for variables, but played around with hosts too)<\/li>\n<li><a href=\"http:\/\/docs.ansible.com\/ansible\/playbooks_variables.html\">Variables<\/a> (lists definitions for tasks, variables for templates)<\/li>\n<li>Templates (.gitconfig with the user name, email, and GitHub username).<\/li>\n<\/ul>\n<p>One of the things that I haven&#8217;t tried yet is using non-core modules (<a href=\"https:\/\/galaxy.ansible.com\/\">Ansible Galaxy<\/a>, etc). \u00a0I will, eventually. \u00a0But for now I have to say that Ansible provides enough functionality out of the box to run the most common tasks.<\/p>\n<p>When I was done, the resulting change set had (according to <em>diffstat<\/em>):<\/p>\n<ul>\n<li>213 files changed,<\/li>\n<li>2,177 lines inserted,<\/li>\n<li>11,975 lines deleted.<\/li>\n<\/ul>\n<p>The majority of these changes were, of course, the removal of Puppet modules from the repository, not the actual configurations.<\/p>\n<p>My initial impressions are:<\/p>\n<ul>\n<li>Ansible is indeed much easier and simpler to get started with. \u00a0Maybe because I&#8217;ve already been through the configuration management initiation with Puppet.<\/li>\n<li>Like any other system, it has its quirks, which will need time to get used to. \u00a0For example, recursively coping a directory locally is not as easy as you might think.<\/li>\n<li>YAML is not as bad as it looks, once you&#8217;ve been editing it for a couple of hours non-stop.<\/li>\n<\/ul>\n<p>Overall, I&#8217;m pretty happy with how it goes. \u00a0Next up &#8211; trying it out for provisioning some of my servers. \u00a0And then, if all goes well, using it for project deployment as well.<\/p>\n<!-- google_ad_section_end -->\n","protected":false},"excerpt":{"rendered":"<!-- google_ad_section_start -->\n<p>After all the reading about Ansible that I&#8217;ve done yesterday, I woke up today with a strong will to try it out. \u00a0Running a few &#8220;hello world&#8221; examples wasn&#8217;t illustrative enough, so I decided to migrate my dotfiles repository from Puppet to Ansible. \u00a0This would provide just enough complexity to try things out, without any &hellip; <a href=\"https:\/\/mamchenkov.net\/wordpress\/2016\/04\/01\/first-attempt-at-ansible\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">First attempt at Ansible<\/span><\/a><\/p>\n<!-- google_ad_section_end -->\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"First attempt at Ansible #Ansible #DevOps #SysAdmin","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_links_to":"","_links_to_target":""},"categories":[1,6,18,133,62,1334],"tags":[3383],"keyring_services":[],"class_list":["post-25986","post","type-post","status-publish","format-standard","hentry","category-general","category-linux","category-programming","category-sysadmin","category-technology","category-web-work","tag-ansible"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":25985,"url":"https:\/\/mamchenkov.net\/wordpress\/2016\/04\/01\/checking-out-ansible-sorry-puppet\/","url_meta":{"origin":25986,"position":0},"title":"Checking out Ansible. Sorry Puppet","author":"Leonid Mamchenkov","date":"April 1, 2016","format":false,"excerpt":"It's Thursday evening of a particularly difficult week at work. \u00a0Tomorrow is a public holiday, effectively making this\u00a0- a Friday. \u00a0My brain is blank and exhausted, so I can't do anything productive. \u00a0And I'm too tired to go out. \u00a0But I can still learn a thing or two. First things\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":27398,"url":"https:\/\/mamchenkov.net\/wordpress\/2017\/03\/08\/how-to-use-git-to-manage-your-user-configuration-files\/","url_meta":{"origin":25986,"position":1},"title":"How To Use Git to Manage your User Configuration Files","author":"Leonid Mamchenkov","date":"March 8, 2017","format":false,"excerpt":"There is probably a gadzillion different ways that you can manage and synchronize you configuration files (aka dotfiles) between different Linux\/UNIX boxes - anything from custom symlink scripts, all the way to configuration management tools like Puppet and Ansible. \u00a0Here are a few options to look at if you are\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":29221,"url":"https:\/\/mamchenkov.net\/wordpress\/2019\/01\/15\/managing-dotfiles-with-rcm\/","url_meta":{"origin":25986,"position":2},"title":"Managing dotfiles with rcm","author":"Leonid Mamchenkov","date":"January 15, 2019","format":false,"excerpt":"These days it is a common practices to manage, version, and share configuration files for command line tools (bash, vim, etc) via a GitHub repository. There are plenty of open repositories to study and borrow things from, as well as the tools and scripts to help one with setting things\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2019\/01\/dotfiles.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2019\/01\/dotfiles.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2019\/01\/dotfiles.jpg?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2019\/01\/dotfiles.jpg?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":25991,"url":"https:\/\/mamchenkov.net\/wordpress\/2016\/04\/01\/ansible-setup-for-fedora-project\/","url_meta":{"origin":25986,"position":3},"title":"Ansible setup for Fedora project","author":"Leonid Mamchenkov","date":"April 1, 2016","format":false,"excerpt":"Real life working examples are some of the most useful things when learning a new system. \u00a0The more - the better. \u00a0That's why this git repository of the Ansible setup for the Fedora project is a pure gold mine. \u00a0It is large. \u00a0It is complex. \u00a0It covers a whole lot\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":26860,"url":"https:\/\/mamchenkov.net\/wordpress\/2016\/11\/08\/install-ansible-2-0-on-amazon-ami\/","url_meta":{"origin":25986,"position":4},"title":"Install Ansible 2.0+ on Amazon AMI","author":"Leonid Mamchenkov","date":"November 8, 2016","format":false,"excerpt":"Today, while upgrading some of my Ansible roles I've hit the problem. \u00a0Some of the newer roles require Ansible 2.0. \u00a0My Amazon AMI machine that runs the playbooks was still on version 1.9. \u00a0EPEL repository doesn't seem to have the newer Ansible version yet. \u00a0Gladly, Google brough in this StackOverflow\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":27259,"url":"https:\/\/mamchenkov.net\/wordpress\/2017\/01\/20\/parsing-text-printouts-within-ansible-playbooks\/","url_meta":{"origin":25986,"position":5},"title":"Parsing text printouts within Ansible playbooks","author":"Leonid Mamchenkov","date":"January 20, 2017","format":false,"excerpt":"I'm sure this will come handy soon, and I'll be spending too much time trying to figure it out without this article:\u00a0Parsing text printouts within Ansible playbooks. It's not every day that you see regular expression examples in the Ansible playbooks...","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/25986","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/comments?post=25986"}],"version-history":[{"count":0,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/25986\/revisions"}],"wp:attachment":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/media?parent=25986"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/categories?post=25986"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/tags?post=25986"},{"taxonomy":"keyring_services","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/keyring_services?post=25986"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}