Skip to content
This repository has been archived by the owner on Jun 14, 2023. It is now read-only.

Policy facts details #376

Merged
merged 5 commits into from
Jun 10, 2019
Merged

Policy facts details #376

merged 5 commits into from
Jun 10, 2019

Conversation

rickardk-se
Copy link
Contributor

@rickardk-se rickardk-se commented May 29, 2019

So I wanted to be able to get all policy rules and the details of each rule. First I solved it by getting all rule names and then querying each rule by name. For 800 rules this took around 10 minutes to complete. I added the argument all_details to get all policy rules and the specific details at the same time. Now the playbook finish in ~10 seconds. Please let me know what you think.

Copy link
Collaborator

@shinmog shinmog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few minor things, but otherwise looks good!

library/panos_security_rule_facts.py Show resolved Hide resolved
@@ -72,6 +75,104 @@
returned: When I(rule_name) is not specified
type: list
sample: ['rule1', 'rule2', 'rule3']
rules_verbose:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your docstring says it's returning full policy details, so maybe change the output variable to policy, as I think it would be nicer to see that in your playbook instead of rules_verbose.

@@ -72,6 +75,104 @@
returned: When I(rule_name) is not specified
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update this "returned" spec as you don't have a rules output when all_details == True.

Copy link
Collaborator

@shinmog shinmog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there I think

library/panos_security_rule_facts.py Outdated Show resolved Hide resolved
library/panos_security_rule_facts.py Outdated Show resolved Hide resolved
@rickardk-se
Copy link
Contributor Author

I'm sorry for the silly mistakes, I should have tested it before committing. It's now updated and tested with expected results.

@rickardk-se rickardk-se closed this Jun 7, 2019
@rickardk-se rickardk-se reopened this Jun 7, 2019
Copy link
Collaborator

@shinmog shinmog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@shinmog shinmog merged commit c2ce2d9 into PaloAltoNetworks:develop Jun 10, 2019
shinmog added a commit that referenced this pull request Jun 11, 2019
* Declare module encoding

* adding function to turn pandevice objects to dicts

* adding panos_zone_facts

* Module ipv4 proxyid for ipsec tunnel (#380)

* Added module panos_ipsec_ipv4_proxyid

* Fixed test build problem

* Applied changes requested by @shinmog

* Fix build problem

* Additionally requested changes by @shinmog

* adding panos_virtual_router_facts (#383)

* fixing RETURNS section

* adding panos_l3_subinterface (#384)

* Correcting example documentation

* adding panos_l2_subinterface (#385)

* Policy facts details (#376)

* Updated documentation for security_rule_facts

* Documentation re-built

* Get full details when querying all rules using 'all_details: yes' argument

* Small fixes to panos_security_rule_facts

* Bug fixes panos_security_rule_facts.py

* Fixup for hyphens/dashes with extra bytes (#387)

* Adding param: 'vsys_shared' (#388)

* adding support for log forwarding profiles (#391)

* adding support for log forwarding profiles

* fixing code style issue

* adding support for email profiles (#389)

* adding support for snmp profiles (#392)

* adding support for syslog profiles (#393)

* adding support for syslog profiles

* fixing code style issue

* adding support for http profiles (#390)

* correcting arg to vsys_shared

* adding panos_type_cmd (#394)

* Updating to 2.2.0 (#395)
@rickardk-se rickardk-se deleted the policy_facts_details branch June 13, 2019 12:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants