PaloAltoNetworks / terraform-provider-panos

Terraform Panos provider
https://www.terraform.io/docs/providers/panos/
MIT License
89 stars 73 forks source link

Updates instructions for commit code #361

Closed jamesholland-uk closed 1 year ago

jamesholland-uk commented 2 years ago

Description

Updating instructions for creating a Go binary to use for executing PAN-OS commits

Motivation and Context

Use of go get has been changed and the current instructions no longer work. This PR suggests updated instructions.

How Has This Been Tested?

Test locally on my machine.

$ ls -las
total 8
0 drwxr-xr-x  3 jholland  staff    96 16 Nov 17:13 .
0 drwxr-xr-x  8 jholland  staff   256 16 Nov 17:13 ..
8 -rw-r--r--  1 jholland  staff  2863 16 Nov 17:13 firewall-commit.go

$ go mod init example/user/panos-commit
go: creating new go.mod: module example/user/panos-commit
go: to add module requirements and sums:
    go mod tidy

$ go mod tidy
go: finding module for package github.com/PaloAltoNetworks/pango/commit
go: finding module for package github.com/PaloAltoNetworks/pango
go: found github.com/PaloAltoNetworks/pango in github.com/PaloAltoNetworks/pango v0.9.0
go: found github.com/PaloAltoNetworks/pango/commit in github.com/PaloAltoNetworks/pango v0.9.0

$ go build firewall-commit.go

$ firewall-commit -h
Usage of /Users/jholland/bin:
  -admins string
        CSV of specific admins for partial config commit
  -config string
        JSON config file with panos connection info
  -exclude-device-and-network
        Exclude device and network
  -exclude-policy-and-objects
        Exclude policy and objects
  -exclude-shared-objects
        Exclude shared objects
  -force
        Force a commit even if one isn't needed
  -host string
        PAN-OS hostname
  -key string
        PAN-OS API key
  -pass string
        PAN-OS password
  -sleep int
        Seconds to sleep between checks for commit completion (default 1)
  -timeout int
        The timeout for all PAN-OS API calls (default 10)
  -user string
        PAN-OS username

Types of changes

Checklist

jamesholland-uk commented 2 years ago

Let me know what you think @shinmog

This would close #358