Arnaud Rebillout: Installing an older Ansible version via pipx
Latest Ansible requires Python 3.8 on the remote hosts
... and therefore, hosts running Debian Buster are now unsupported.
Monday, I updated the system on my laptop (Debian Sid), and I got the latest
version of
To my surprise, Ansible started to fail with some remote hosts:
Installing Ansible via pipx
Lately I discovered pipx and it's incredibly simple,
so I thought I'd give it a try for this use-case.
Reminder:
Note: at the moment
Meaning:
Yep! And that's working already, I can use Ansible with Buster hosts again.
What's cool is that we can run
The issue here is that we need
Problem fixed! Of course you'll have to iterate to install other missing
dependencies, depending on which Ansible external plugins are used in your
playbooks.
Closing thoughts
Hopefully there's nothing left to discover and I can get back to work! If
there's more quirks and rough edges, drop me an email so that I can update
this blog post.
Let me also credit another useful blog post on the matter:
https://unfriendlygrinch.info/posts/effortless-ansible-installation/
ansible-core, 2.18:
$ ansible --version head -1
ansible [core 2.18.0]
ansible-core requires a minimum of Python version 3.8. Current version: 3.7.3 (default, Mar 23 2024, 16:12:05) [GCC 8.3.0]Yep, I do have to work with hosts running Debian Buster (aka. oldoldstable). While Buster is old, it's still out there, and it's still supported via Freexian s Extended LTS. How are we going to keep managing those machines? Obviously, we'll need an older version of Ansible. Pipx to the rescue TL;DR
pipx install --include-deps ansible==10.6.0
pipx inject ansible dnspython # for community.general.dig
pipx allows users to install Python applications in isolated
environments. In other words, it doesn't make a mess with your system like
pip does, and it doesn't require you to learn how to setup Python virtual
environments by yourself. It doesn't ask for root privileges either, as it
installs everything under ~/.local/.
First thing to know: pipx install ansible won't cut it, it doesn't install
the whole Ansible suite. Instead we need to use the --include-deps flag in
order to install all the Ansible commands.
The output should look something like that:
$ pipx install --include-deps ansible==10.6.0
installed package ansible 10.6.0, installed using Python 3.12.7
These apps are now globally available
- ansible
- ansible-community
- ansible-config
- ansible-connection
- ansible-console
- ansible-doc
- ansible-galaxy
- ansible-inventory
- ansible-playbook
- ansible-pull
- ansible-test
- ansible-vault
done!
10.6.0 is the latest release of the 10.x branch, but
make sure to check https://pypi.org/project/ansible/#history and install
whatever is the latest on this branch. The 11.x branch doesn't work for us,
as it's the branch that comes with ansible-core 2.18, and we don't want that.
Next: do NOT run pipx ensurepath, even though pipx might suggest that. This
is not needed. Instead, check your ~/.profile, it should contain these lines:
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
fi
~/.local/bin/ should already be in your path, unless it's the
first time you installed a program via pipx and the directory ~/.local/bin/
was just created. If that's the case, you have to log out and log back in.
Now, let's open a new terminal and check if we're good:
$ which ansible
/home/me/.local/bin/ansible
$ ansible --version head -1
ansible [core 2.17.6]
ansible to use this specific Ansible version,
but we can also run /usr/bin/ansible to run the latest version that is
installed via APT.
Injecting Python dependencies needed by collections
Quickly enough, I realized something odd, apparently the plugin
community.general.dig didn't work anymore. After some research, I found a
one-liner to test that:
# Works with APT-installed Ansible? Yes!
$ /usr/bin/ansible all -i localhost, -m debug -a msg=" lookup('dig', 'debian.org./A') "
localhost SUCCESS =>
"msg": "151.101.66.132,151.101.2.132,151.101.194.132,151.101.130.132"
# Works with pipx-installed Ansible? No!
$ ansible all -i localhost, -m debug -a msg=" lookup('dig', 'debian.org./A') "
localhost FAILED! =>
"msg": "An unhandled exception occurred while running the lookup plugin 'dig'.
Error was a <class 'ansible.errors.AnsibleError'>, original message: The dig
lookup requires the python 'dnspython' library and it is not installed."
python3-dnspython, which is installed on my
system, but is not installed within the pipx virtual environment. It seems that
the way to go is to inject the required dependencies in the venv, which is
(again) super easy:
$ pipx inject ansible dnspython
injected package dnspython into venv ansible
done!




Notes to self. And anyone else who might find them useful. Following are some ssacli commands which I use infrequently enough that they fall out of cache. This may repeat information in other blogs, but since I search my posts first when commands slip my mind, I thought I d include them here, too.
debian.org's infrastructure now supports using Security Key-backed SSH keys. DDs (and guests) can use the mail gateway to add SSH keys of the types sk-ecdsa-sha2-nistp256@openssh.com and sk-ssh-ed25519@openssh.com to their LDAP accounts.This was done in support of hardening our infrastructure: Hopefully we can require these hardware-backed keys for sensitive machines in the future, to have some assertion that it is a human that is connecting to them.
In basically every engineering organization I ve ever regarded as particularly
high functioning, I ve sat through one specific recurring conversation which is
not a conversation about complexity . Things are good or bad because they
are or aren t complex, architectures needs to be redone because it s too
complex some refactor of whatever it is won t work because it s too complex.
You may have even been a part of some of these conversations or even been
the one advocating for simple light-weight solutions. I ve done it. Many times.
Rarely, if ever, do we talk about complexity within its rightful context
complexity for whom. Is a solution complex because it s complex for the
end user? Is it complex if it s complex for an API consumer? Is it complex if
it s complex for the person maintaining the API service? Is it complex if it s
complex for someone outside the team maintaining it to understand?
Complexity within a problem domain I ve come to believe, is fairly zero-sum
there s a fixed amount of complexity in the problem to be solved, and you can
choose to either solve it, or leave it for those downstream of you
to solve that problem on their own.
That being said, while I believe there is a lower bound in complexity to
contend with for a problem, I do not believe there is an upper bound to the
complexity of solutions possible. It is always possible, and in fact, very
likely that teams create problems for themselves while trying to solve a
problem. The rest of this post is talking to the lower bound. When getting
feedback on an early draft of this blog post, I ve been informed that Fred
Brooks coined a term for what I call lower bound complexity Essential
Complexity , in the paper
In 2004, I was living in London, and decided it was time I had my own little virtual private server somewhere online. As a Debian developer since the start of 2000, it had to be Debian, and it still is This was before cloud as we know it today. Virtual Private Servers (VPS) was a
Like each month, have a look at the work funded by











I was interested in learning about 

Dear Debian community,
this is Bits from DPL for October. In addition to a summary of my
recent activities, I aim to include newsworthy developments within
Debian that might be of interest to the broader community. I believe
this provides valuable insights and foster a sense of connection across
our diverse projects. Also, I welcome your feedback on the format and
focus of these Bits, as community input helps shape their value.
Ada Lovelace Day 2024
As outlined in my platform, I'm committed to increasing the diversity of
Debian developers. I hope the recent article celebrating Ada Lovelace
Day 2024 featuring interviews with
The coffee shop Ibtehal and me used to visit during the midnight
Grating at a chemist shop in Mombasa, Kenya
Me with players at the Nairobi Gymkhana Club
Cricket pitch at the Nairobi Gymkhana Club
A view of the cricket ground inside the Nairobi Gymkhana Club
Scoreboard at the Nairobi Gymkhana cricket ground
A matatu with a Notorious BIG portrait.
Inside the Giraffe Center
SGR train at Nairobi Terminus.
Interior of the SGR train
Mombasa Terminus station.
The balcony at Tulia Backpackers Hostel had a nice view of the ocean.
A room inside the hostel with fans and mosquito nets on the beds
Nyali beach is a white sand beach
This is the ferry service for crossing the river.
Diani beach is a popular beach in Kenya. It is a white sand beach.
Selfie with truck drivers who gave me the free ride
Newspapers at a stand in Kenya covering news on the airport closure
Spanish Omelette served in breakfast at Nairobi Transit Hotel
Ugali with eggs.
Almost all of my Debian contributions this month were
](https://jmtd.net/log/synths/microfreak/400x-microfreak.jpg)
