You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ansible errors with "Missing required library "pan-os-python"." when paloaltonetworks.panos is used under Python 3.12 even when pan-os-python, pan-python, and xmltodict are installed
Expected behavior
Ansible tasks should run without errors
Current behavior
Ansible errors with "Missing required library "pan-os-python"."
Possible solution
This is happening because distutils was removed from Python 3.12
This is a work around for end users, not a good solution. pip install setuptools
I suspect that the correct solution will be using a different packaging formula.
Steps to reproduce
Set up the environment
`python -m venv ansible_test
Describe the bug
Ansible errors with "Missing required library "pan-os-python"." when paloaltonetworks.panos is used under Python 3.12 even when pan-os-python, pan-python, and xmltodict are installed
Expected behavior
Ansible tasks should run without errors
Current behavior
Ansible errors with "Missing required library "pan-os-python"."
Possible solution
This is happening because distutils was removed from Python 3.12
This is a work around for end users, not a good solution.
pip install setuptools
I suspect that the correct solution will be using a different packaging formula.
Steps to reproduce
Set up the environment
`python -m venv ansible_test
. ansible_test/bin/activate
pip install ansible
pip install pan-os-python pan-python xmltodict
ansible-galaxy collection install paloaltonetworks.panos'
create the playbook
`---
name: Gather system info
hosts: "firewall"
connection: local
vars:
device:
ip_address: "{{ ip_address }}"
username: "{{ username }}"
password: "{{ password }}"
collections:
tasks:
name: Gather facts for device
paloaltonetworks.panos.panos_facts:
provider: "{{ device }}"
name: Display information
ansible.builtin.debug:
msg:
- "Hostname: {{ ansible_facts['net_hostname'] }}"
- "Serial: {{ ansible_facts['net_serial'] }}"
- "Model: {{ ansible_facts['net_model'] }}"
- "Version: {{ ansible_facts['net_version'] }}"
- "Uptime: {{ ansible_facts['net_uptime'] }}"
- "HA Enabled: {{ ansible_facts['net_ha_enabled'] }}"
- "HA Type: {{ ansible_facts['net_ha_localmode'] }}"
- "HA Status: {{ ansible_facts['net_ha_localstate'] }}"
- "Multi-VSYS: {{ ansible_facts['net_multivsys'] }}"
- "{{ ansible_facts['net_session_usage'] }} out of {{ ansible_facts['net_session_max'] }} sessions in use"
`
ansible-playbook -i inventory.ini get-system-info.yml
Context
I am trying to manage my PanOS device with Ansible using Python 3.12
Your Environment
Workaround for end users
pip install setuptools
The text was updated successfully, but these errors were encountered: