AnsiblePilot — Master Ansible Automation
AnsiblePilot is the leading resource for learning Ansible automation, DevOps, and infrastructure as code. Browse over 1,400 tutorials covering Ansible modules, playbooks, roles, collections, and real-world examples. Whether you are a beginner or an experienced engineer, our step-by-step guides help you automate Linux, Windows, cloud, containers, and network infrastructure.
Popular Topics
About Luca Berton
Luca Berton is an Ansible automation expert, author of 8 Ansible books published by Apress and Leanpub including "Ansible for VMware by Examples" and "Ansible for Kubernetes by Example", and creator of the Ansible Pilot YouTube channel. He shares practical automation knowledge through tutorials, books, and video courses to help IT professionals and DevOps engineers master infrastructure automation.
How to install Ansible in Debian 11 - Ansible install — Video Tutorial
The easier way to install the latest version of Ansible and maintain up-to-date in Debian 11 using APT and the \"main\" default repository.
What You'll Learn
- How to install Ansible in Debian
- code
- execution
- before execution
- after execution
- Troubleshooting Common Installation Issues
- 1. Wrong Python interpreter
- 2. SELinux / AppArmor blocking ansible
- 3. SSH key authentication failing
- 4. `pip install` conflicts with system packages
Full Tutorial Content
How to install Ansible in Debian version 11?
Today we're going to talk about the easier way to install and maintain Ansible inside Debian using the default "main" repository.
I'm Luca Berton and welcome to today's episode of Ansible Pilot.
How to install Ansible in Debian
- Included in the "main" default repository
Today we're talking about How to install Ansible in Debian.
The good news is that Ansible is included in the default repository so you could install it simply with your usual package manager "apt".
You could expect the latest version of Ansible in the "main" repository.
## Playbook
Install Ansible in Debian using the apt package manager and the "main" default repository.
code
- install-ansible-debian.sh
```bash
#!/bin/bash
$ sudo apt-get update
$ sudo apt-get install ansible
$ sudo apt list –installed ansible
```
execution
```bash
ansible-pilot $ ssh devops@debian.example.com
Linux debian 5.10.0-9-amd64 #1 SMP Debian 5.10.70-1 (2021-09-30) x86_64
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
$ sudo su
root@debian:/home/devops# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
root@debian:/home/devops# cat /etc/deb
debconf.conf debian_version
root@debian:/home/devops# cat /etc/debian_version
11.1
root@debian:/home/devops# apt-get update
Get:1 http://security.debian.org/debian-security bullseye-security InRelease [44.1 kB]
Hit:2 http://deb.debian.org/debian bullseye InRelease
Get:3 http://deb.debian.org/debian bullseye-updates InRelease [39.4 kB]
Get:4 http://deb.debian.org/debian bullseye-backports InRelease [43.7 kB]
Get:5 http://deb.debian.org/debian bullseye-backports/main Sources.diff/Index [63.3 kB]
Get:6 http://deb.debian.org/debian bullseye-backports/main amd64 Packages.diff/Index [63.3 kB]
Get:7 http://deb.debian.org/debian bullseye-backports/main Sources T-2021-12-02-0202.04-F-2021-12-02-0202.04.pdiff [29 B]
Get:7 http://deb.debian.org/debian bullseye-backports/main Sources T-2021-12-02-0202.04-F-2021-12-02-0202.04.pdiff [29 B]
Get:8 http://deb.debian.org/debian bullseye-backports/main amd64 Packages T-2021-12-02-0202.04-F-2021-12-02-0202.04.pdiff [257 B]
Get:8 http://deb.debian.org/debian bullseye-backports/main amd64 Packages T-2021-12-02-0202.04-F-2021-12-02-0202.04.pdiff [257 B]
Fetched 254 kB in 1s (488 kB/s)
Reading package lists... Done
root@debian:/home/devops# apt-cache search ansible
ansible - Configuration management, deployment, and task execution system
ansible-lint - lint tool for Ansible playbooks
ansible-mitogen - Fast
About This Tutorial
- Author: Luca Berton
- Difficulty: Beginner
- Read time: 13 min
- Category: installation
Read the full written article: How to install Ansible in Debian 11 - Ansible install