{"id":1569,"date":"2016-12-06T07:26:48","date_gmt":"2016-12-06T07:26:48","guid":{"rendered":"http:\/\/cloudkul.com\/blog\/?p=1569"},"modified":"2017-06-14T11:33:41","modified_gmt":"2017-06-14T11:33:41","slug":"installation-ansible-ubuntu-14-04","status":"publish","type":"post","link":"https:\/\/cloudkul.com\/blog\/installation-ansible-ubuntu-14-04\/","title":{"rendered":"Installation of Ansible on ubuntu 14.04"},"content":{"rendered":"<p style=\"text-align: justify\">Ansible is configuration management and provisioning tool, quite similar to puppet or chef. It is a simple IT automation system that handles configuration-management, application deployment, cloud provisioning, multiple task execution and multi-node orchestration, including trivializing things like zero downtime rolling updates with load balancers.<\/p>\n<p style=\"text-align: justify\">These configuration management systems are used to act as a servers for administration and operation that allow you to control many different systems in an automated way from one central location. Thus, we can have a centralized server to control and configure all the client machines.<\/p>\n<p style=\"text-align: justify\">For IT personnels, tasks can be repetitive and exploiting same amount of resources over similar tasks is not a good way to go. With this automation tool, IT admins can automate their tasks and speedup their efforts. It uses simple, less complex way to begin with it. It uses SSH connection from server side to client side and no configuration is required to be done on the clients side. Automation and configuration management makes a lot of sense when it cuts down setup time and efforts.<\/p>\n<h4 style=\"text-align: justify\">Ansible Installation<\/h4>\n<p style=\"text-align: justify\">Update your server and install software-properties-common package to work with PPA,<\/p>\n<pre class=\"lang:default decode:true \">sudo su\r\napt-get update\r\napt-get install software-properties-common\r\n<\/pre>\n<p style=\"text-align: justify\">Add PPA repository,<\/p>\n<pre class=\"lang:default decode:true \">apt-add-repository ppa:ansible\/ansible<\/pre>\n<p style=\"text-align: justify\">Now, update the repository and install the package,<\/p>\n<pre class=\"lang:default decode:true\">apt-get update\r\napt-get install ansible\r\n<\/pre>\n<p style=\"text-align: justify\">Create SSH key pairs to let host communicates with clients using SSH connections,<\/p>\n<pre class=\"lang:default decode:true \">ssh-keygen<\/pre>\n<p style=\"text-align: justify\">This will create RSA key pairs.<\/p>\n<p style=\"text-align: justify\">Now configure the hosts you want to control by ansible,<\/p>\n<pre class=\"lang:default decode:true \">nano \/etc\/ansible\/hosts<\/pre>\n<pre class=\"lang:default decode:true\"># If you have multiple hosts following a pattern you can specify\r\n# them like this:\r\n[TESTING]\r\nhost1 ansible_ssh_host=192.168.1.64\r\nhost2 ansible_ssh_host=192.168.1.10\r\n<\/pre>\n<p style=\"text-align: justify\">You can allot group name to client&#8217;s IP addresses. Like&#8217; TESTING&#8217; is a group assigned to the above mentioned clients.<\/p>\n<p style=\"text-align: justify\">Close the hosts file.<\/p>\n<p style=\"text-align: justify\">Now mention the SSH user present on the client that you are accessing via SSH connection,<\/p>\n<pre class=\"lang:default decode:true\">mkdir \/etc\/ansible\/group_vars\r\nnano \/etc\/ansible\/group_vars\/TESTING<\/pre>\n<p style=\"text-align: justify\">Files should be in YAML format so it must begin with &#8220;&#8212;&#8221; ,<\/p>\n<pre class=\"lang:default decode:true\">---\r\n\r\nansible_ssh_user: test\r\n<\/pre>\n<p style=\"text-align: justify\">Close the file.<\/p>\n<p style=\"text-align: justify\">Now the copy the ssh-key to the clients as,<\/p>\n<pre class=\"lang:default decode:true\">ssh-copy-id test@192.168.1.64\r\nssh-copy-id test@192.168.1.10\r\n<\/pre>\n<p style=\"text-align: justify\">Now check the connectivity with clients as,<\/p>\n<pre class=\"lang:default decode:true \">ansible -m ping all<\/pre>\n<p style=\"text-align: justify\">If you get,<\/p>\n<pre class=\"lang:default decode:true\">host1 | SUCCESS =&gt; {\r\n    \"changed\": false, \r\n    \"ping\": \"pong\"\r\n}\r\n\r\nhost2 | SUCCESS =&gt; {\r\n    \"changed\": false, \r\n    \"ping\": \"pong\"\r\n}<\/pre>\n<p style=\"text-align: justify\">It also uses ad-hoc commands and playbooks (written in YAML format) for automation and provisioning. In our next blog, we will begin with writing playbooks and execution of ad-hoc commands.<\/p>\n<p style=\"text-align: center\"><a href=\"http:\/\/cloudkul.com\/contact\/\" target=\"_blank\" rel=\"noopener noreferrer\">IN CASE OF ANY\u00a0QUERY, CONTACT US<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ansible is configuration management and provisioning tool, quite similar to puppet or chef. It is <a class=\"text-primary\" title=\"read more\" href=\"https:\/\/cloudkul.com\/blog\/installation-ansible-ubuntu-14-04\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":7,"featured_media":1575,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1],"tags":[92,169],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Installation of Ansible on ubuntu 14.04 - Cloudkul<\/title>\n<meta name=\"description\" content=\"Ansible is configuration management and provisioning tool, quite similar to puppet or chef. It is a simple IT automation system that handles configuration-management, application deployment, cloud provisioning, multiple task execution and multinode orchestration, including trivializing things like zero downtime rolling updates with load balancers.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cloudkul.com\/blog\/installation-ansible-ubuntu-14-04\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Installation of Ansible on ubuntu 14.04 - Cloudkul\" \/>\n<meta property=\"og:description\" content=\"Ansible is configuration management and provisioning tool, quite similar to puppet or chef. It is a simple IT automation system that handles configuration-management, application deployment, cloud provisioning, multiple task execution and multinode orchestration, including trivializing things like zero downtime rolling updates with load balancers.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cloudkul.com\/blog\/installation-ansible-ubuntu-14-04\/\" \/>\n<meta property=\"og:site_name\" content=\"Cloudkul\" \/>\n<meta property=\"article:published_time\" content=\"2016-12-06T07:26:48+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-06-14T11:33:41+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2016\/12\/u9oWRT7C.png\" \/>\n\t<meta property=\"og:image:width\" content=\"848\" \/>\n\t<meta property=\"og:image:height\" content=\"422\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Alankrit Srivastava\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cloudkul.com\/blog\/installation-ansible-ubuntu-14-04\/\",\"url\":\"https:\/\/cloudkul.com\/blog\/installation-ansible-ubuntu-14-04\/\",\"name\":\"Installation of Ansible on ubuntu 14.04 - Cloudkul\",\"isPartOf\":{\"@id\":\"https:\/\/cloudkul.com\/blog\/#website\"},\"datePublished\":\"2016-12-06T07:26:48+00:00\",\"dateModified\":\"2017-06-14T11:33:41+00:00\",\"author\":{\"@id\":\"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/fc06bfd7f18d9a606dd94062d205af16\"},\"description\":\"Ansible is configuration management and provisioning tool, quite similar to puppet or chef. It is a simple IT automation system that handles configuration-management, application deployment, cloud provisioning, multiple task execution and multinode orchestration, including trivializing things like zero downtime rolling updates with load balancers.\",\"breadcrumb\":{\"@id\":\"https:\/\/cloudkul.com\/blog\/installation-ansible-ubuntu-14-04\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cloudkul.com\/blog\/installation-ansible-ubuntu-14-04\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cloudkul.com\/blog\/installation-ansible-ubuntu-14-04\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/cloudkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Installation of Ansible on ubuntu 14.04\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/cloudkul.com\/blog\/#website\",\"url\":\"https:\/\/cloudkul.com\/blog\/\",\"name\":\"Cloudkul\",\"description\":\"Host your eCommerce Store on AWS with Optimized Performance\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/cloudkul.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/fc06bfd7f18d9a606dd94062d205af16\",\"name\":\"Alankrit Srivastava\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/955c3dda2678272c436c5153832e401f?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/955c3dda2678272c436c5153832e401f?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g\",\"caption\":\"Alankrit Srivastava\"},\"description\":\"DevOps Manager at Webkul Software Privated Limited\",\"sameAs\":[\"http:\/\/cloudkul.com\"],\"url\":\"https:\/\/cloudkul.com\/blog\/author\/alankrit-srivastava256\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Installation of Ansible on ubuntu 14.04 - Cloudkul","description":"Ansible is configuration management and provisioning tool, quite similar to puppet or chef. It is a simple IT automation system that handles configuration-management, application deployment, cloud provisioning, multiple task execution and multinode orchestration, including trivializing things like zero downtime rolling updates with load balancers.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/cloudkul.com\/blog\/installation-ansible-ubuntu-14-04\/","og_locale":"en_US","og_type":"article","og_title":"Installation of Ansible on ubuntu 14.04 - Cloudkul","og_description":"Ansible is configuration management and provisioning tool, quite similar to puppet or chef. It is a simple IT automation system that handles configuration-management, application deployment, cloud provisioning, multiple task execution and multinode orchestration, including trivializing things like zero downtime rolling updates with load balancers.","og_url":"https:\/\/cloudkul.com\/blog\/installation-ansible-ubuntu-14-04\/","og_site_name":"Cloudkul","article_published_time":"2016-12-06T07:26:48+00:00","article_modified_time":"2017-06-14T11:33:41+00:00","og_image":[{"width":848,"height":422,"url":"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2016\/12\/u9oWRT7C.png","type":"image\/png"}],"author":"Alankrit Srivastava","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/cloudkul.com\/blog\/installation-ansible-ubuntu-14-04\/","url":"https:\/\/cloudkul.com\/blog\/installation-ansible-ubuntu-14-04\/","name":"Installation of Ansible on ubuntu 14.04 - Cloudkul","isPartOf":{"@id":"https:\/\/cloudkul.com\/blog\/#website"},"datePublished":"2016-12-06T07:26:48+00:00","dateModified":"2017-06-14T11:33:41+00:00","author":{"@id":"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/fc06bfd7f18d9a606dd94062d205af16"},"description":"Ansible is configuration management and provisioning tool, quite similar to puppet or chef. It is a simple IT automation system that handles configuration-management, application deployment, cloud provisioning, multiple task execution and multinode orchestration, including trivializing things like zero downtime rolling updates with load balancers.","breadcrumb":{"@id":"https:\/\/cloudkul.com\/blog\/installation-ansible-ubuntu-14-04\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cloudkul.com\/blog\/installation-ansible-ubuntu-14-04\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/cloudkul.com\/blog\/installation-ansible-ubuntu-14-04\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cloudkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Installation of Ansible on ubuntu 14.04"}]},{"@type":"WebSite","@id":"https:\/\/cloudkul.com\/blog\/#website","url":"https:\/\/cloudkul.com\/blog\/","name":"Cloudkul","description":"Host your eCommerce Store on AWS with Optimized Performance","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cloudkul.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/fc06bfd7f18d9a606dd94062d205af16","name":"Alankrit Srivastava","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/955c3dda2678272c436c5153832e401f?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/955c3dda2678272c436c5153832e401f?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g","caption":"Alankrit Srivastava"},"description":"DevOps Manager at Webkul Software Privated Limited","sameAs":["http:\/\/cloudkul.com"],"url":"https:\/\/cloudkul.com\/blog\/author\/alankrit-srivastava256\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts\/1569"}],"collection":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/comments?post=1569"}],"version-history":[{"count":9,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts\/1569\/revisions"}],"predecessor-version":[{"id":2876,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts\/1569\/revisions\/2876"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/media\/1575"}],"wp:attachment":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/media?parent=1569"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/categories?post=1569"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/tags?post=1569"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}