Debian 12 - Install Ansible
This brief tutorial provides you instructions on how to install Ansible on Debian 12 systems for if you wanted to control other systems, as well as how to install the base packages for if you just want your Debian 12 system to be managed by an Ansible controller.
Controller Install Methods
Choose one of the two following methods to install Ansible for if you wish to control use ansible to manage other systems.
1. Use Local Repostitories (Recommended)
The simplest (recommended) installation method is to run:
sudo apt-get install ansible -y
2.14.18
, using python 3.11.2
at the time of writing this.
2. Pipx Method
Alternatively you can install from source to get a more recent version: 2.18.1
.
sudo apt install pipx -y
pipx install --include-deps ansible
Updating PATH Variable
This will install ansible to the running users $HOME/.local/pipx
area, whilst creating symlinks in your $HOME/.local/bin
It will warn you if this path is not part of your $PATH variable, in which case you can manually include it by
editing your $PATH in your .bashrc file, or you can run the following:
pipx ensurepath
... which does this for you.
BASH Completions
You may also with to run the following to install BASH completions for pipx
eval "$(register-python-argcomplete pipx)"
Controlled System Base Installation
If you only need your Debian 12 system to be controlled by another system that acts as your Ansible controller,
then you only need to install the ansible-core
package with:
sudo apt update && sudo apt install ansible-core -y
References
First published: 19th January 2025