Deprecated

Removed in 2.12

i

Reason:Consolidating code base. | Alternative:Use U(https://galaxy.ansible.com/PaloAltoNetworks/paloaltonetworks) instead.

community.general.panos_set (0.1.1) — module

Execute arbitrary commands on a PAN-OS device using XPath and element

Authors: Jasper Mackenzie (@spmp)

deprecated | supported by community

Install collection

Install with ansible-galaxy collection install community.general:==0.1.1


Add to requirements.yml

  collections:
    - name: community.general
      version: 0.1.1

Description

Run an arbitrary 'xapi' command taking an XPath (i.e get) or XPath and element (i.e set).

See https://github.com/kevinsteves/pan-python/blob/master/doc/pan.xapi.rst for details

Runs a 'set' command by default

This should support _all_ commands that your PAN-OS device accepts vi it's cli

cli commands are found as

Once logged in issue 'debug cli on'

Enter configuration mode by issuing 'configure'

Enter your set (or other) command, for example 'set deviceconfig system timezone Australia/Melbourne'

returns

"<request cmd="set" obj="/config/devices/entry[@name='localhost.localdomain']/deviceconfig/system" cookie=XXXX><timezone>Australia/Melbourne</timezone></request>

The 'xpath' is "/config/devices/entry[@name='localhost.localdomain']/deviceconfig/system"

The 'element' is "<timezone>Australia/Melbourne</timezone>"


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.

- name: Set timezone on PA NVA
  panos_set:
    ip_address: "192.168.1.1"
    username: "my-random-admin"
    password: "admin1234"
    xpath: "/config/devices/entry/deviceconfig/system"
    element: "<timezone>Australia/Melbourne</timezone>"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Commit configuration
  panos_commit:
    ip_address: "192.168.1.1"
    username: "my-random-admin"
    password: "admin1234"

Inputs

    
xpath:
    description:
    - The 'xpath' for the commands configurable
    required: true

command:
    choices:
    - set
    - edit
    - delete
    - get
    - show
    - override
    default: set
    description:
    - Xapi method name which supports 'xpath' or 'xpath' and 'element'

element:
    description:
    - The 'element' for the 'xpath' if required

password:
    description:
    - Password for the given 'username'
    required: true
    type: str

username:
    default: admin
    description:
    - User name for a user with admin rights on the PAN-OS NVA
    type: str

ip_address:
    description:
    - IP address or host FQDN of the target PAN-OS NVA
    required: true
    type: str