ansible-install | ansible | ansible-ntp | ansible-rhel
see the version you would get from debian/ubuntu
apt show ansible-core | grep ^Version
go for the official one for ubuntu but also works for debian
# no exist ls -lhF /usr/share/keyrings/*ansible* ls -lhF /etc/apt/sources.list.d/*ansible* apt install gnupg1 lsb-release keyid=0x6125E2A8C77F2818FB7BD15B93C4A3FD7BB9C367 wget "https://keyserver.ubuntu.com/pks/lookup?fingerprint=on&op=get&search=$keyid" -O /usr/share/keyrings/ansible.asc gpg1 --dearmor < /usr/share/keyrings/ansible.asc > /usr/share/keyrings/ansible.gpg
choose the appropriate distro to get latest version
lsb_release -cs 2>/dev/null release=`lsb_release -cs 2>/dev/null` # ubuntu questing goes plucky for now (Jan 2026) release=plucky # debian bookworm goes jammy release=jammy
cat > /etc/apt/sources.list.d/ansible.list <<EOF deb [signed-by=/usr/share/keyrings/ansible.gpg] http://ppa.launchpad.net/ansible/ansible/ubuntu $release main EOF
and proceed
apt update apt show ansible-core | grep ^Version apt install ansible-core
fixup
ls -lF /etc/ansible/ansible.cfg rmdir /etc/ansible/roles/
also get rsync in there, as for the synchronize module
apt install rsync
as user
ansible-galaxy collection install -U ansible.posix ansible-galaxy collection install -U community.docker ansible-galaxy collection install -U community.general
same goes if you need to upgrade one of those at some point (-U / --upgrade is already there)
you might prefer v2.16 to remain compatible with python 3.6 target systems
cat > /etc/apt/sources.list.d/ansible.list <<EOF deb [signed-by=/usr/share/keyrings/ansible.gpg] http://ppa.launchpad.net/ansible/ansible/ubuntu mantic main EOF
and proceed
apt install ansible-core=2.16.8-1ppa~mantic -t mantic
https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html
https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-ansible-on-debian-11