{"id":13771,"date":"2019-04-06T03:06:53","date_gmt":"2019-04-06T03:06:53","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=13771"},"modified":"2019-04-06T03:06:53","modified_gmt":"2019-04-06T03:06:53","slug":"how-to-install-and-configure-ansible-on-ubuntu-18-04","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/04\/06\/how-to-install-and-configure-ansible-on-ubuntu-18-04\/","title":{"rendered":"How to Install and Configure Ansible on Ubuntu 18.04"},"content":{"rendered":"<div class=\"postable-info-bar-container\">\n<div class=\"postable-info-bar\">\n<div class=\"right-section\">\n<div class=\"section-item social-sharing-item\">\n<div class=\"sharing\"><img decoding=\"async\" class=\"tutorial-image\" style=\"font-size: 1rem;\" title=\"How to Install and Configure Ansible on Ubuntu 18.04\" src=\"https:\/\/community-cdn-digitalocean-com.global.ssl.fastly.net\/assets\/tutorials\/images\/large\/Ansible_Configure_twitter_mostov_.png?1532382476\" alt=\"How to Install and Configure Ansible on Ubuntu 18.04\" \/><span style=\"font-size: 1.5rem;\">How to Install and Configure Ansible on Ubuntu 18.04<\/span><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"container tutorial-header\"><\/div>\n<div class=\"container versioned-tutorial-group-navigation\" data-versioned-tutorial-group-navigation=\"\">\n<div class=\"versioned-tutorial-group-navigation__header\" data-versioned-tutorial-group-navigation-header=\"\">\n<h5 class=\"versioned-tutorial-group-navigation__heading\">Not using\u00a0<strong>Ubuntu 18.04<\/strong>? Choose a different version:<\/h5>\n<\/div>\n<div class=\"versioned-tutorial-group-navigation__body\" data-versioned-tutorial-group-navigation-body=\"\">\n<ul class=\"versioned-tutorial-group-navigation__list\">\n<li class=\"versioned-tutorial-group-navigation__list-item\"><a class=\"versioned-tutorial-group-navigation__link\" href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-and-configure-ansible-on-centos-7\">CentOS 7<\/a><\/li>\n<li class=\"versioned-tutorial-group-navigation__list-item\"><a class=\"versioned-tutorial-group-navigation__link\" href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-and-configure-ansible-on-ubuntu-16-04\">Ubuntu 16.04<\/a><\/li>\n<li class=\"versioned-tutorial-group-navigation__list-item\"><a class=\"versioned-tutorial-group-navigation__link\" href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-and-configure-ansible-on-ubuntu-14-04\">Ubuntu 14.04<\/a><\/li>\n<li class=\"versioned-tutorial-group-navigation__list-item\"><a class=\"versioned-tutorial-group-navigation__link versioned-tutorial-group-navigation__link--unavailable\" data-tutorial-request=\"\" data-distribution-version-id=\"12\" data-versioned-tutorial-group-id=\"68\">Automated: Docker<small class=\"versioned-tutorial-group-navigation__request\" data-tutorial-request-status-indicator=\"\">request<\/small><\/a><\/li>\n<li class=\"versioned-tutorial-group-navigation__list-item\"><a class=\"versioned-tutorial-group-navigation__link versioned-tutorial-group-navigation__link--unavailable\" data-tutorial-request=\"\" data-distribution-version-id=\"14\" data-versioned-tutorial-group-id=\"68\">Automated: Bash<small class=\"versioned-tutorial-group-navigation__request\" data-tutorial-request-status-indicator=\"\">request<\/small><\/a><\/li>\n<li class=\"versioned-tutorial-group-navigation__list-item\"><a class=\"versioned-tutorial-group-navigation__link versioned-tutorial-group-navigation__link--unavailable\" data-tutorial-request=\"\" data-distribution-version-id=\"13\" data-versioned-tutorial-group-id=\"68\">Automated: Ansible<small class=\"versioned-tutorial-group-navigation__request\" data-tutorial-request-status-indicator=\"\">request<\/small><\/a><\/li>\n<li class=\"versioned-tutorial-group-navigation__list-item\"><a class=\"versioned-tutorial-group-navigation__link versioned-tutorial-group-navigation__link--unavailable\" data-tutorial-request=\"\" data-distribution-version-id=\"6\" data-versioned-tutorial-group-id=\"68\">Debian 9<small class=\"versioned-tutorial-group-navigation__request\" data-tutorial-request-status-indicator=\"\">request<\/small><\/a><\/li>\n<li class=\"versioned-tutorial-group-navigation__list-item\"><a class=\"versioned-tutorial-group-navigation__link versioned-tutorial-group-navigation__link--unavailable\" data-tutorial-request=\"\" data-distribution-version-id=\"7\" data-versioned-tutorial-group-id=\"68\">Debian 8<small class=\"versioned-tutorial-group-navigation__request\" data-tutorial-request-status-indicator=\"\">request<\/small><\/a><\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div class=\"content-body tutorial-content\" data-growable-markdown=\"\">\n<h3 id=\"introduction\"><strong>Introduction<\/strong><\/h3>\n<p>Configuration management systems are designed to make controlling large numbers of servers easy for administrators and operations teams. They allow you to control many different systems in an automated way from one central location.<\/p>\n<p>While there are many popular configuration management systems available for Linux systems, such as Chef and Puppet, these are often more complex than many people want or need.\u00a0<a href=\"https:\/\/www.ansible.com\/\">Ansible<\/a>\u00a0is a great alternative to these options because it requires a much smaller overhead to get started.<\/p>\n<p>In this guide, we will discuss how to install Ansible on an Ubuntu 18.04 server and go over some basics of how to use the software.<\/p>\n<h2 id=\"how-does-ansible-work\"><strong>How Does Ansible Work?<\/strong><\/h2>\n<p>Ansible works by configuring client machines from a computer that has the Ansible components installed and configured.<\/p>\n<p>It communicates over normal SSH channels to retrieve information from remote machines, issue commands, and copy files. Because of this, an Ansible system does not require any additional software to be installed on the client computers.<\/p>\n<p>This is one way that Ansible simplifies the administration of servers. Any server that has an SSH port exposed can be brought under Ansible&#8217;s configuration umbrella, regardless of what stage it is at in its life cycle. This means that any computer that you can administer through SSH, you can also administer through Ansible.<\/p>\n<p>Ansible takes on a modular approach, making it easy to extend to use the functionalities of the main system to deal with specific scenarios. Modules can be written in any language and communicate in standard JSON.<\/p>\n<p>Configuration files are mainly written in the YAML data serialization format due to its expressive nature and its similarity to popular markup languages. Ansible can interact with hosts either through command line tools or its configuration scripts, which are known as Playbooks.<\/p>\n<h2 id=\"prerequisites\"><strong>Prerequisites<\/strong><\/h2>\n<p>To follow this tutorial, you will need:<\/p>\n<ul>\n<li>Two or more Ubuntu 18.04 servers. One of these will be used as your\u00a0<em>Ansible server<\/em>, while the remainder will be used as your\u00a0<em>Ansible hosts<\/em>. Each should have a non-<strong>root<\/strong>\u00a0user with\u00a0<code>sudo<\/code>\u00a0privileges and a basic firewall configured. You can set this up by following our\u00a0<a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/initial-server-setup-with-ubuntu-18-04\">Initial Server Setup Guide for Ubuntu 18.04<\/a>. Please note that the examples throughout this guide specify three Ansible hosts, but the commands and configurations shown can be adjusted for any number of clients.<\/li>\n<li>SSH keys generated for the non-<strong>root<\/strong>\u00a0user on your Ansible server. To do this, follow Step 1 of our guide on\u00a0<a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-set-up-ssh-keys-on-ubuntu-1804\">How to Set Up SSH Keys on Ubuntu 18.04<\/a>. For the purposes of this tutorial, you can save the key pair to the default location (<code>~\/.ssh\/id_rsa<\/code>) and you do not need to password-protect it.<\/li>\n<\/ul>\n<h2 id=\"step-1-\u2014-installing-ansible\"><strong>Step 1 \u2014 Installing Ansible<\/strong><\/h2>\n<p>To begin using Ansible as a means of managing your various servers, you need to install the Ansible software on at least one machine.<\/p>\n<p>To get the latest version of Ansible for Ubuntu, you can add the project&#8217;s PPA (personal package archive) to your system. Before doing this, though, you should first ensure that you have the\u00a0<code>software-properties-common<\/code>\u00a0package installed. This software will make it easier to manage this and other independent software repositories:<\/p>\n<pre class=\"code-pre command\"><code><\/code><\/pre>\n<ul class=\"prefixed\">\n<li class=\"line\">sudo apt update<\/li>\n<li class=\"line\">sudo apt install software-properties-common<\/li>\n<\/ul>\n<pre class=\"code-pre command\"><code><\/code><\/pre>\n<p>Then add the Ansible PPA by typing the following command:<\/p>\n<pre class=\"code-pre command\"><code><\/code><\/pre>\n<ul class=\"prefixed\">\n<li class=\"line\">sudo apt-add-repository ppa:ansible\/ansible<\/li>\n<\/ul>\n<pre class=\"code-pre command\"><code><\/code><\/pre>\n<p>Press\u00a0<code>ENTER<\/code>\u00a0to accept the PPA addition.<\/p>\n<p>Next, refresh your system&#8217;s package index once again so that it is aware of the packages available in the PPA:<\/p>\n<pre class=\"code-pre command\"><code><\/code><\/pre>\n<ul class=\"prefixed\">\n<li class=\"line\">sudo apt update<\/li>\n<\/ul>\n<pre class=\"code-pre command\"><code><\/code><\/pre>\n<p>Following this update, you can install the Ansible software:<\/p>\n<pre class=\"code-pre command\"><code><\/code><\/pre>\n<ul class=\"prefixed\">\n<li class=\"line\">sudo apt install ansible<\/li>\n<\/ul>\n<pre class=\"code-pre command\"><code><\/code><\/pre>\n<p>Your Ansible server now has all of the software required to administer your hosts.<\/p>\n<h2 id=\"step-2-\u2014-configuring-ssh-access-to-the-ansible-hosts\"><strong>Step 2 \u2014 Configuring SSH Access to the Ansible Hosts<\/strong><\/h2>\n<p>As mentioned previously, Ansible primarily communicates with client computers through SSH. While it certainly has the ability to handle password-based SSH authentication, using SSH keys can help to keep things simple.<\/p>\n<p>On your Ansible server, use the\u00a0<code>cat<\/code>\u00a0command to print the contents of your non-root user\u2019s SSH public key file to the terminal\u2019s output:<\/p>\n<pre class=\"code-pre command\"><code><\/code><\/pre>\n<ul class=\"prefixed\">\n<li class=\"line\">cat ~\/.ssh\/id_rsa.pub<\/li>\n<\/ul>\n<pre class=\"code-pre command\"><code><\/code><\/pre>\n<p>Copy the resulting output to your clipboard, then open a new terminal and connect to one of your Ansible hosts using SSH:<\/p>\n<pre class=\"code-pre command local-environment\"><code><\/code><\/pre>\n<ul class=\"prefixed\">\n<li class=\"line\">ssh <span class=\"highlight\">sammy<\/span>@<span class=\"highlight\">ansible_host_ip<\/span><\/li>\n<\/ul>\n<pre class=\"code-pre command local-environment\"><code><\/code><\/pre>\n<p>Switch to the client machine\u2019s\u00a0<strong>root<\/strong>\u00a0user:<\/p>\n<pre class=\"code-pre command second-environment\"><code><\/code><\/pre>\n<ul class=\"prefixed\">\n<li class=\"line\">su &#8211;<\/li>\n<\/ul>\n<pre class=\"code-pre command second-environment\"><code><\/code><\/pre>\n<p>As the\u00a0<strong>root<\/strong>\u00a0user, open the\u00a0<code>authorized_keys<\/code>\u00a0within the\u00a0<code>~\/.ssh<\/code>\u00a0directory:<\/p>\n<pre class=\"code-pre super_user second-environment\"><code><\/code><\/pre>\n<ul class=\"prefixed\">\n<li class=\"line\">nano ~\/.ssh\/authorized_keys<\/li>\n<\/ul>\n<pre class=\"code-pre super_user second-environment\"><code><\/code><\/pre>\n<p>In the file, paste your Ansible server user\u2019s SSH key, then save the file and close the editor (press\u00a0<code>CTRL + X<\/code>,\u00a0<code>Y<\/code>, then\u00a0<code>ENTER<\/code>). Then run the\u00a0<code>exit<\/code>\u00a0command to return to the host\u2019s non-<strong>root<\/strong>\u00a0user:<\/p>\n<pre class=\"code-pre super_user second-environment\"><code><\/code><\/pre>\n<ul class=\"prefixed\">\n<li class=\"line\">exit<\/li>\n<\/ul>\n<pre class=\"code-pre super_user second-environment\"><code><\/code><\/pre>\n<p>Lastly, because Ansible uses a python interpreter located at\u00a0<code>\/usr\/bin\/python<\/code>\u00a0to run its modules, you\u2019ll need to install Python 2 on the host in order for Ansible to communicate with it. Run the following commands to update the host\u2019s package index and install the\u00a0<code>python<\/code>\u00a0package:<\/p>\n<pre class=\"code-pre command second-environment\"><code><\/code><\/pre>\n<ul class=\"prefixed\">\n<li class=\"line\">sudo apt update<\/li>\n<li class=\"line\">sudo apt install python<\/li>\n<\/ul>\n<pre class=\"code-pre command second-environment\"><code><\/code><\/pre>\n<p>Following this, you can run the\u00a0<code>exit<\/code>\u00a0command once again to close the connection to the client:<\/p>\n<pre class=\"code-pre command second-environment\"><code><\/code><\/pre>\n<ul class=\"prefixed\">\n<li class=\"line\">exit<\/li>\n<\/ul>\n<pre class=\"code-pre command second-environment\"><code><\/code><\/pre>\n<p>Repeat this process for each server you intend to control with your Ansible server. Next, we\u2019ll configure the Ansible server to connect to these hosts using Ansible\u2019s\u00a0<code>hosts<\/code>\u00a0file.<\/p>\n<h2 id=\"step-3-\u2014-setting-up-ansible-hosts\"><strong>Step 3 \u2014 Setting Up Ansible Hosts<\/strong><\/h2>\n<p>Ansible keeps track of all of the servers that it knows about through a\u00a0<code>hosts<\/code>\u00a0file. We need to set up this file first before we can begin to communicate with our other computers.<\/p>\n<p>Open the file with\u00a0<code>sudo<\/code>\u00a0privileges, like this:<\/p>\n<pre class=\"code-pre command\"><code><\/code><\/pre>\n<ul class=\"prefixed\">\n<li class=\"line\">sudo nano \/etc\/ansible\/hosts<\/li>\n<\/ul>\n<pre class=\"code-pre command\"><code><\/code><\/pre>\n<p>Inside the file, you will see a number of example configurations that have been commented out (with a\u00a0<code>#<\/code>preceding each line). These examples won\u2019t actually work for us since the hosts listed in each one are made up. We will, however, keep these examples in the file to help us with configuration if we want to implement more complex scenarios in the future.<\/p>\n<p>The\u00a0<code>hosts<\/code>\u00a0file is fairly flexible and can be configured in a few different ways. The syntax we are going to use, though, looks like this:<\/p>\n<pre class=\"code-pre \"><code>[<span class=\"highlight\">group_name<\/span>]\r\n<span class=\"highlight\">alias<\/span> ansible_host=<span class=\"highlight\">your_server_ip<\/span>\r\n<\/code><\/pre>\n<p><span class=\"note\"><strong>Note:<\/strong>\u00a0With the release of Ansible version 2.0, the configuration variable\u00a0<code>ansible_host<\/code>\u00a0replaced the original variable,\u00a0<code>ansible_ssh_host<\/code>. If you&#8217;re using an older version of Ansible, you should use the older, longer variable.<br \/>\n<\/span><\/p>\n<p>In this example,\u00a0<code>group_name<\/code>\u00a0is an organizational tag that lets you refer to any servers listed under it with one word, while\u00a0<code>alias<\/code>\u00a0is just a name to refer to one specific server.<\/p>\n<p>So, in our scenario, we are imagining that we have three servers we are going to control with Ansible. At this point, these servers are accessible from the Ansible server by typing:<\/p>\n<pre class=\"code-pre command\"><code><\/code><\/pre>\n<ul class=\"prefixed\">\n<li class=\"line\">ssh root@<span class=\"highlight\">ansible_host_ip<\/span><\/li>\n<\/ul>\n<pre class=\"code-pre command\"><code><\/code><\/pre>\n<p>You should not be prompted for a password if you have set this up correctly. For the purpose of demonstration, we will assume that our hosts&#8217; IP addresses are\u00a0<code>203.0.113.1<\/code>,\u00a0<code>203.0.113.2<\/code>, and\u00a0<code>203.0.113.3<\/code>. We will set this up so that we can refer to these individually as\u00a0<code>host1<\/code>,\u00a0<code>host2<\/code>, and\u00a0<code>host3<\/code>, or as a group with the name\u00a0<code>servers<\/code>.<\/p>\n<p>This is the block that we should add to our\u00a0<code>hosts<\/code>\u00a0file to accomplish this:<\/p>\n<div class=\"code-label \" title=\"\/etc\/ansible\/hosts\">\/etc\/ansible\/hosts<\/div>\n<pre class=\"code-pre \"><code>[servers]\r\nhost1 ansible_host=<span class=\"highlight\">203.0.113.1<\/span>\r\nhost2 ansible_host=<span class=\"highlight\">203.0.113.2<\/span>\r\nhost3 ansible_host=<span class=\"highlight\">203.0.113.3<\/span>\r\n<\/code><\/pre>\n<p>Hosts can be in multiple groups and groups can configure parameters for all of their members. Let&#8217;s try this out now.<\/p>\n<p>With our current settings, if we tried to connect to any of these hosts with Ansible, the command would fail (assuming you are not operating as the root user). This is because your SSH key is embedded for the\u00a0<strong>root<\/strong>user on the remote systems and Ansible will by default try to connect as your current user. A connection attempt will get this error:<\/p>\n<pre class=\"code-pre \"><code><\/code><\/pre>\n<div class=\"secondary-code-label \" title=\"Output\">Output<\/div>\n<pre class=\"code-pre \"><code>host1 | UNREACHABLE! =&gt; {\r\n    \"changed\": false,\r\n    \"msg\": \"Failed to connect to the host via ssh.\",\r\n    \"unreachable\": true\r\n}\r\n<\/code><\/pre>\n<p>On the Ansible server, we&#8217;re using a user called\u00a0<strong>sammy<\/strong>. Ansible will try to connect to each host with\u00a0<code>ssh sammy@server<\/code>. This will not work if the\u00a0<strong>sammy<\/strong>\u00a0user is not on the remote system as well.<\/p>\n<p>We can create a file that tells all of the servers in the &#8220;servers&#8221; group to connect as the\u00a0<strong>root<\/strong>\u00a0user.<\/p>\n<p>To do this, we will create a directory in the Ansible configuration structure called\u00a0<code>group_vars<\/code>. Within this folder, we can create YAML-formatted files for each group we want to configure:<\/p>\n<pre class=\"code-pre command\"><code><\/code><\/pre>\n<ul class=\"prefixed\">\n<li class=\"line\">sudo mkdir \/etc\/ansible\/group_vars<\/li>\n<li class=\"line\">sudo nano \/etc\/ansible\/group_vars\/servers<\/li>\n<\/ul>\n<pre class=\"code-pre command\"><code><\/code><\/pre>\n<p>YAML files start with &#8220;&#8212;&#8220;, so make sure you don&#8217;t forget that part.<\/p>\n<div class=\"code-label \" title=\"\/etc\/ansible\/group_vars\/servers\">\/etc\/ansible\/group_vars\/servers<\/div>\n<pre class=\"code-pre \"><code>---\r\nansible_user: root\r\n<\/code><\/pre>\n<p><span class=\"note\"><strong>Note:<\/strong>\u00a0Similar to the\u00a0<code>ansible_host<\/code>\u00a0variable,\u00a0<code>ansible_user<\/code>\u00a0replaced the variable\u00a0<code>ansible_ssh_user<\/code>\u00a0with the release of version 2.0. If you&#8217;re using an older version of Ansible than 2.0, be sure to use the older, longer variable.<br \/>\n<\/span><\/p>\n<p>Save and close this file when you are finished.<\/p>\n<p>If you want to specify configuration details for every server, regardless of group association, you can put those details in a file at\u00a0<code>\/etc\/ansible\/group_vars\/all<\/code>. Individual hosts can be configured by creating files named after their alias under a directory at\u00a0<code>\/etc\/ansible\/host_vars<\/code>.<\/p>\n<h2 id=\"step-4-\u2014-using-simple-ansible-commands\"><strong>Step 4 \u2014 Using Simple Ansible Commands<\/strong><\/h2>\n<p>Now that we have our hosts set up and enough configuration details to allow us to successfully connect to our hosts, we can try out our very first command.<\/p>\n<p>Ping all of the servers you configured by typing:<\/p>\n<pre class=\"code-pre command\"><code><\/code><\/pre>\n<ul class=\"prefixed\">\n<li class=\"line\">ansible -m ping all<\/li>\n<\/ul>\n<pre class=\"code-pre command\"><code><\/code><\/pre>\n<div class=\"code-label \" title=\"Ping output\">Ping output<\/div>\n<pre class=\"code-pre \"><code>host1 | SUCCESS =&gt; {\r\n    \"changed\": false,\r\n    \"ping\": \"pong\"\r\n}\r\n\r\nhost3 | 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}\r\n<\/code><\/pre>\n<p>This is a basic test to make sure that Ansible has a connection to all of its hosts.<\/p>\n<p>The\u00a0<code>all<\/code>\u00a0means all hosts. We could just as easily specify a group:<\/p>\n<pre class=\"code-pre command\"><code><\/code><\/pre>\n<ul class=\"prefixed\">\n<li class=\"line\">ansible -m ping servers<\/li>\n<\/ul>\n<pre class=\"code-pre command\"><code><\/code><\/pre>\n<p>We could also specify an individual host:<\/p>\n<pre class=\"code-pre command\"><code><\/code><\/pre>\n<ul class=\"prefixed\">\n<li class=\"line\">ansible -m ping host1<\/li>\n<\/ul>\n<pre class=\"code-pre command\"><code><\/code><\/pre>\n<p>We can specify multiple hosts by separating them with colons:<\/p>\n<pre class=\"code-pre command\"><code><\/code><\/pre>\n<ul class=\"prefixed\">\n<li>ansible -m ping host1:host2<\/li>\n<\/ul>\n<pre class=\"code-pre command\"><code><\/code><\/pre>\n<p>The\u00a0<code>-m ping<\/code>\u00a0portion of the command is an instruction to Ansible to use the &#8220;ping&#8221; module. These are basically commands that you can run on your remote hosts. The ping module operates in many ways like the normal\u00a0<code>ping<\/code>\u00a0utility in Linux, but instead it checks for Ansible connectivity.<\/p>\n<p>The ping module doesn&#8217;t really take any arguments, but we can try another command to see how that works. We pass arguments into a script by typing\u00a0<code>-a<\/code>.<\/p>\n<p>The &#8220;shell&#8221; module lets us send a terminal command to the remote host and retrieve the results. For instance, to find out the memory usage on our host1 machine, we could use:<\/p>\n<pre class=\"code-pre command\"><code><\/code><\/pre>\n<ul class=\"prefixed\">\n<li class=\"line\">ansible -m shell -a &#8216;free -m&#8217; host1<\/li>\n<\/ul>\n<pre class=\"code-pre command\"><code><\/code><\/pre>\n<div class=\"code-label \" title=\"Shell output\">Shell output<\/div>\n<pre class=\"code-pre \"><code>host1 | SUCCESS | rc=0 &gt;&gt;\r\n             total       used       free     shared    buffers     cached\r\nMem:          3954        227       3726          0         14         93\r\n-\/+ buffers\/cache:        119       3834\r\nSwap:            0          0          0\r\n<\/code><\/pre>\n<p>With that, your Ansible server configured and you can successfully communicate and control your hosts.<\/p>\n<h2 id=\"conclusion\"><strong>Conclusion<\/strong><\/h2>\n<p>In this tutorial, we have configured Ansible and verified that it can communicate with each host. We have also used the\u00a0<code>ansible<\/code>\u00a0command to execute simple tasks remotely.<\/p>\n<p>Although this is useful, we have not covered the most powerful feature of Ansible in this article: Playbooks. Ansible Playbooks are a powerful, simple way to manage server configurations and multi-machine deployments. For an introduction to Playbooks, see\u00a0<a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/configuration-management-101-writing-ansible-playbooks\">this guide<\/a>. Additionally, we encourage you to check out the\u00a0<a href=\"https:\/\/docs.ansible.com\/ansible\/latest\/index.html\">official Ansible documentation<\/a>\u00a0to learn more about the tool.<\/p>\n<p><a style=\"font-size: 1rem;\" href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-and-configure-ansible-on-ubuntu-18-04\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>How to Install and Configure Ansible on Ubuntu 18.04 Not using\u00a0Ubuntu 18.04? Choose a different version: CentOS 7 Ubuntu 16.04 Ubuntu 14.04 Automated: Dockerrequest Automated: Bashrequest Automated: Ansiblerequest Debian 9request Debian 8request Introduction Configuration management systems are designed to make controlling large numbers of servers easy for administrators and operations teams. They allow you to &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/04\/06\/how-to-install-and-configure-ansible-on-ubuntu-18-04\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to Install and Configure Ansible on Ubuntu 18.04&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-13771","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13771","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=13771"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13771\/revisions"}],"predecessor-version":[{"id":13772,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13771\/revisions\/13772"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=13771"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=13771"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=13771"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}