Sowohl unter Linux (Ubuntu) als auch MacOS habe ich Probleme mit Ansible-Playbooks, wenn Ansible > Version 2.17 auf einem Zielsystem mit RHEL 8 dort „Gather Facts“ sammelt. Das Playbook bricht dann direkt am Anfang ab. Ansible erwartet auf den Zielsystem mindestens Python 3.7. Hosts mit RHEL 8 haben aber Python 3.6.
Workaround für Ubuntu um Ansible 2.16 zu instalieren
wget -O /tmp/ansible-core_2.16.8-1ppa~mantic_all.deb https://ppa.launchpadcontent.net/ansible/ansible/ubuntu/pool/main/a/ansible-core/ansible-core_2.16.8-1ppa~mantic_all.deb
sudo dpkg -i /tmp/ansible-core_2.16.8-1ppa~mantic_all.deb
sudo apt-mark hold ansible-core
Workaround für MacOS um Ansible 2.16 zu instalieren
Variante 1
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install ansible@9
echo 'export PATH="/opt/homebrew/opt/ansible@9/bin:$PATH"' >> ~/.profile
Variante 2
python3 -m pip install ansible-core==2.16.10