ricsanfre / pi-cluster

Pi Kubernetes Cluster. Homelab kubernetes cluster automated with Ansible and ArgoCD
https://picluster.ricsanfre.com
MIT License
348 stars 56 forks source link

Ansible python interpreter warning #435

Closed ricsanfre closed 4 days ago

ricsanfre commented 3 weeks ago

The following warning message is showed whenever gathering_facts is enabled in Ansible's playbook

[WARNING]: Platform linux on host node1 is using the discovered Python interpreter at /usr/bin/python3.10, but future
installation of another Python interpreter could change the meaning of that path. See https://docs.ansible.com/ansible-
core/2.17/reference_appendices/interpreter_discovery.html for more information.

Ansible version:

ansible --version
ansible [core 2.17.0]
  config file = /runner/ansible.cfg
  configured module search path = ['/home/runner/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.12/site-packages/ansible
  ansible collection location = /runner/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.12.4 (main, Jun  7 2024, 19:18:12) [GCC 12.2.0] (/usr/local/bin/python)
  jinja version = 3.1.4
  libyaml = True
ricsanfre commented 4 days ago

As specified in Ansible's Interpreter discovery documentation, for silencing the warning messages a global configuration can be added to ansible.cfg

[default]
interpreter_python = auto_silent

It also can be specified per hosts or group of hots in inventory file using ansible_python_interpreter variable.