Ansible panos_type_cmd | send arbitrary command to firewall via Panorama

Announcements

Changes to the LIVEcommunity experience are coming soon... Here's what you need to know.

Reply
Aidar5
L0 Member

Ansible panos_type_cmd | send arbitrary command to firewall via Panorama

Hello,

I tried to get information from firewall via Panorama using Ansible panos_type_cmd module. But in response I see: "msg": "******** not connected".

Could you someone advise how to debug this or check the correctness of playbook:

---

- hosts: Panorama
  connection: local
  gather_facts: no

  vars:
     provider:
        ip_address: '{{ "Panorama IP" }}'
        username: xxx
        password: yyy
        serial_number: "SN OF END FIREWALL"
     ansible_python_interpreter: /usr/bin/python3.6

tasks:
  - name: Show management IP.
    paloaltonetworks.panos.panos_type_cmd:
       provider: '{{ provider }}'
       cmd: 'show'
       xpath: |
          /config/devices/entry[@name='localhost.localdomain']
          /deviceconfig/system/ip-address
    register: response
  - debug: msg="{{ response.stdout }}"

 

This playbook works when connected to firewall itself.

Thank you in advance.

Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!