Skip to Content
Ansible: Up and Running, 3rd Edition
book

Ansible: Up and Running, 3rd Edition

by Bas Meijer, Lorin Hochstein, René Moser
July 2022
Intermediate to advanced
472 pages
10h 21m
English
O'Reilly Media, Inc.
Content preview from Ansible: Up and Running, 3rd Edition

Chapter 2. Installation and Setup

Ansible is written in Python for use on Linux/macOS/BSD systems. It can target all kinds of systems, and you generally do not need to install anything on the target systems, assuming that the Linux/macOS/BSD systems have Python installed and that Windows machines have PowerShell. So generally you will install Ansible on your workstation. Python 3.8 is recommended on the machine where you run Ansible.

Installing Ansible

All the major Linux distributions package Ansible these days, so if you work on a Linux machine, you can use your native package manager for a casual installation (although this might be an older version of Ansible). If you work on macOS, I recommend using the excellent Homebrew package manager to install Ansible:

$ brew install ansible

On any Unix/Linux/macOS machine, you can install Ansible using one of the Python package managers. This way you can add Python-based tools and libraries that work for you, provided you add ~/.local/bin to your PATH shell variable. If you want to work with Ansible Tower or AWX, then you should install the same version of ansible-core on your workstation.

$ pip3 install --user ansible==2.9.27

Using pip3 to install a version above 2.10 (e.g., 5.9.0) installs all standard collections as well. It’s still “batteries included.”

Note

If you work on multiple projects, you should install Ansible into a Python virtualenv. This lets you avoid interfering with your system Python or cluttering your user environment. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Kubernetes: Up and Running, 3rd Edition

Kubernetes: Up and Running, 3rd Edition

Brendan Burns, Joe Beda, Kelsey Hightower, Lachlan Evenson

Publisher Resources

ISBN: 9781098109141Errata Page