Menu

How to Install and Set Up Ansible on Ubuntu (First Playbook)
πŸ“°

How to Install and Set Up Ansible on Ubuntu (First Playbook)

DEV Community: ansibleΒ·FlatlinerAtheist | CLI-NERDSΒ·about 3 hours ago
#eKJJlIBW
#devtoansible#devto#dev#ansible#install
Reading 0:00
15s threshold

Ansible is the tool that turns "log into 20 servers and run the same commands" into "run one command once." It's agentless β€” nothing to install on the machines you manage, just SSH and Python, which they already have.

This guide gets you from a fresh Ubuntu install to your first working playbook.

Install Ansible on the control node

On Ubuntu, the distro package is fine for getting started:

sudo apt update sudo apt install -y ansible ansible --version

Enter fullscreen mode

Exit fullscreen mode

For the newest release, use pip instead:

sudo apt install -y python3-pip pip install ansible-core

Enter fullscreen mode

Exit fullscreen mode

The machine running Ansible is the control node . Your servers only need SSH access and Python β€” nothing else.

Set up SSH access to your servers

Ansible talks to servers over SSH, so key-based login makes everything smoother:

ssh-copy-id [email protected]

Enter fullscreen mode

Exit fullscreen mode

Repeat for each server.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.