Hi,
I’d like to use ansible-pull
to manage two servers and three desktops in my local network. I’ve read an excellent (though a bit outdated) tutorial about ansible-pull
, and it seems like the right fit for my use case.
I have a minimal installation of Rocky Linux 8 on a test box. I just installed Ansible from EPEL, and I have a first draft of a local.yml
playbook in a GitHub repository here:
I execute ansible-pull
(as root
) with the appropriate URL, and here’s an error I get:
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Failed to import
the required Python library (libselinux-python) on squidbox's Python
/usr/bin/python3.12.
Now this is a known problem with RHEL8 and compatible clones like Rocky Linux 8. In a “classic” Ansible setup, this can be solved simply by defining this in the appropriate place:
ansible_python_interpreter=/usr/bin/python3
The first problem here is that there seems to be no appropriate place with ansible-pull
. Apparently the only solution here is to use an extra variable on the command line like this:
# ansible-pull -U https://github.com/kikinovak/microlinux-squidbox-el8 \
-e ansible_python_interpreter=/usr/bin/python3
This time things work as expected:
TASK [enable_selinux : Enable SELinux in enforcing mode] **************
ok: [localhost]
So my first question would be: how can I define ansible_python_interpreter=/usr/bin/python3
in a permanent way for ansible-pull
?
In a similar way, I have another problem. Every time I call ansible-pull
, I get a series of warnings:
[WARNING]: Could not match supplied host pattern, ignoring: squidbox
[WARNING]: Could not match supplied host pattern, ignoring:
...
[WARNING]: provided hosts list is empty, only localhost is available.
Note that the implicit localhost does not match 'all'
[WARNING]: Could not match supplied host pattern, ignoring: squidbox
[WARNING]: Could not match supplied host pattern, ignoring:
squidbox.microlinux.lan
Apparently there seems to be no way to explain to ansible-pull
that I only want to execute the local.yml
play on localhost
.
Which brings me to my second question: how do I get rid of these useless warnings ?
On a side note: ansible-pull
seems to be the right fit for what I do, but some of its designs details seem… not very smart (to state it politely).
Any suggestions ?
Niki