Open
Conversation
Enhances the panos_commit_all action with device group targeting and
automatic discovery capabilities. Clarifies the action's purpose as a
push-only operation that requires panos_commit to be run first.
Changes:
Action configuration (internal/provider/commit_all.go):
- Add device_groups parameter to allow specifying target device groups
- Update description to clarify this action pushes (not commits) config
- Add types.List field to CommitAllActionModel for device group list
Core implementation (internal/provider/commit_all_crud.go):
- Implement device group auto-discovery from Panorama
- Support multiple XML response formats for cross-version compatibility
- Add fetchAllDeviceGroups() using operational command (show dg-hierarchy)
- Add fetchDeviceGroupsViaConfig() as fallback using config API
- Parse action config to read device_groups parameter
- Build proper XML structure with shared-policy and device group entries
- Add comprehensive logging for debugging
- Improve error messages with actionable solutions
Documentation (docs/actions/commit_all.md):
- Clarify this action does NOT commit, only pushes committed config
- Add "Typical Workflow" section explaining commit-then-push pattern
- Add Configuration section documenting device_groups parameter
- Update all examples to show both panos_commit and panos_commit_all
- Add examples for targeting specific device groups using config block
- Update comparison table with clearer explanations
- Add automated workflow example using lifecycle action_trigger hooks
Examples (examples/COMMIT_ALL_EXAMPLES.md):
- Add comprehensive comparison guide for different approaches
- Include examples for both Terraform Actions and curl methods
- Document the correct workflow with commit before push
- Add quick start guide with step-by-step instructions
Usage:
# Push to all device groups
action "panos_commit_all" "push_all" {}
# Push to specific device groups
action "panos_commit_all" "push_production" {
config {
device_groups = ["Production", "DMZ"]
}
}
Breaking changes: None
Backward compatible: Yes (device_groups is optional)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add panos_commit_all action for Panorama push to devices
Overview
This PR implements a new Terraform action
panos_commit_allthat enables pushing committed configuration from Panorama to managed device groups. This complements the existingpanos_commitaction to provide a complete commit-and-push workflow for Panorama users.Motivation
Currently, the provider has a
panos_commitaction that commits pending changes to Panorama, but there's no way to push those committed changes to managed devices. Users need to manually push via the Panorama UI or use external scripts, breaking the infrastructure-as-code workflow.This action fills that gap by providing a native Terraform way to perform the "Push to Devices" operation.
What's New
Core Features
Automatic Device Group Discovery
show dg-hierarchy) with config API fallbackSelective Device Group Targeting
device_groupsparameter to push to specific groups onlyClear Workflow Separation
Implementation Details
Files Added:
internal/provider/commit_all.go- Action framework and schemainternal/provider/commit_all_crud.go- Core API implementationdocs/actions/commit_all.md- Comprehensive documentation (505 lines)examples/COMMIT_ALL_EXAMPLES.md- Usage guide and comparisonsFiles Modified:
internal/provider/provider.go- Register new actionKey Technical Decisions:
type=commit&action=allwith<commit-all><shared-policy>structureUsage Examples
Basic Usage