Run the Get Facts playbookΒΆ

The get_facts.yml playbook fetches the model type and software version from a PAN-OS device and prints it out to the screen. To see the different types of information you can retrieve, see the panos_facts module documentation.

---
- hosts: lab_fw
  connection: local

  vars:
    device:
      ip_address: '{{ ip_address }}'
      username: '{{ username | default(omit) }}'
      password: '{{ password | default(omit) }}'
      api_key: '{{ api_key | default(omit) }}'

  vars_files:
    - creds.yml

  collections:
    - paloaltonetworks.panos

  tasks:
    - name: Gather facts for device
      panos_facts:
        provider: '{{ device }}'

    - debug:
        msg: "Model: {{ ansible_facts['net_model'] }}, version: {{ ansible_facts['net_version'] }}"

Run the playbook with ansible-playbook:

ansible-playbook -i inventory get_facts.yml  --ask-vault-pass

Output:

../_images/get-facts.png