VOOZH about

URL: https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-ansible-on-ubuntu-18-04

⇱ How to Install and Configure Ansible on Ubuntu 18.04 | DigitalOcean


Not using Ubuntu 18.04?
Choose a different version or distribution.
Ubuntu 18.04
👁 How to Install and Configure Ansible on Ubuntu 18.04

Introduction

Configuration management systems are designed to streamline the process of controlling large numbers of servers, for administrators and operations teams. They allow you to control many different systems in an automated way from one central location.

While there are many popular configuration management tools available for Linux systems, such as Chef and Puppet, these are often more complex than many people want or need. Ansible is a great alternative to these options because it offers a simple architecture that doesn’t require special software to be installed on nodes, using SSH to execute the automation tasks and YAML files to define provisioning details.

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 this software.

Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.

Learn more about our products

About the author(s)

👁 Mark Drake
Mark Drake
Author
Manager, Developer Education
See author profile

Former Technical Writer at DigitalOcean. Focused on SysAdmin topics including Debian 11, Ubuntu 22.04, Ubuntu 20.04, Databases, SQL and PostgreSQL.

👁 Erika Heidi
Erika Heidi
Author
Developer Advocate
See author profile

Dev/Ops passionate about open source, PHP, and Linux. Former Senior Technical Writer at DigitalOcean. Areas of expertise include LAMP Stack, Ubuntu, Debian 11, Linux, Ansible, and more.

Still looking for an answer?

Was this helpful?

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

hello dear people how can i get here your_server_ip   (alias ansible_ssh_host = your_server_ip) Find Thnx

My experience was that I had to softlink python3 to python for this to work on Ubuntu 18.04 or ansible would complain that it couldn’t find /usr/bin/python on each droplet:

 root@my-droplet$sudo ln -s /usr/bin/python3 /usr/bin/python 

I also found that I needed to enter the pass phrase for the ssh cert once per server. After receiving the reply from the first server, I entered the pass phrase even though there was no prompt and this seemed to make it work.

It is probably better to configure the certificate at playbook level rather than globally in any case.

Getting error while doing Ansible-Playbook

host1 | FAILED! => { “changed”: false, “module_stderr”: “Shared connection to 172.31.8.238 closed.\r\n”, “module_stdout”: “/bin/sh: 1: /usr/bin/python: not found\r\n”, “msg”: “MODULE FAILURE\nSee stdout/stderr for the exact error”, “rc”: 127 }

already i have python version Python 2.7.15rc1

ansible_ssh_port deosn’t work anymore with ansibile 2.0 and later version.

Below link for reference.

https://docs.ansible.com/ansible/2.3/intro_inventory.html


Ansible 2.0 has deprecated the “ssh” from ansible_ssh_user, ansible_ssh_host, and ansible_ssh_port to become ansible_user, ansible_host, and ansible_port. If you are using a version of Ansible prior to 2.0, you should continue using the older style variables (ansible_ssh_*). These shorter variables are ignored, without warning, in older versions of Ansible.```

Hello Team,

Under one of my Ansible host, I am unable to locate authorized_keys within the ~/.ssh directory.

KIndly help

Thanks for this! I setup 2 Ubuntu droplets on DO and was able to get everything working by following your tutorial… worked great. I’ll be reading your others, on creating playbooks and such, next.

👁 Creative Commons
This work is licensed under a Creative Commons Attribution-NonCommercial- ShareAlike 4.0 International License.
  • Deploy on DigitalOcean

    Click below to sign up for DigitalOcean's virtual machines, Databases, and AIML products.

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and AI-native businesses

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

© 2026 DigitalOcean, LLC.Sitemap.
Dark mode is coming soon.