PaloAltoNetworks / panhandler

Panhandler is a tool to manage config snippets and Skillets for PAN-OS devices
Apache License 2.0
41 stars 19 forks source link

FR: Support 'depends' keyword in metadata file for pulling in other skillets for snippet re-use #179

Closed nembery closed 3 years ago

nembery commented 4 years ago

Need the ability to pull in 'micro-skillets' / i.e. snippet from other skillets directly. Example is K12 skillet that wants to use most of, but not all, or Iron-Skillet. Currently, they must manually use git operations to fetch and merge changes from upstream. We should be able to simplify this by using the 'depends' keyword.

Ideal usage is to add the following to a skillet metadata file:


depends:
  - url: https://github.com/paloaltonetworks/iron-skillet
    branch: panos_9.0
    name: IronSkilllet

This will construct the proper archive URL for the git site:


curl -L https://github.com/PaloAltoNetworks/iron-skillet/archive/panos_v9.0.tar.gz > is.tar.gz

This will then be exploded into a temporary directory outside of the normal pan_cnc/repostories folder structure. This will allow multiple versions of the same repository to be loaded by different skillets without naming or versioning conflicts.

These downloads should be cached for some time (permanently?)

For git services other than github and gitlab, we can just do a shallow clone into the temp dir instead of grabbing the archive