feature(panos_object_facts): Added support for Custom URL Categories #249
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.
Description
Added support for Custom URL Categories in panos_object_facts.py
Motivation and Context
Needed to be able to read from objects.CustomUrlCategory.
How Has This Been Tested?
Test task:
`
name: Get running config url categories
paloaltonetworks.panos.panos_object_facts:
provider: '{{ provider }}'
object_type: 'custom-url-category'
field: 'name'
field_search_type: 'regex'
field_search_value: '.*'
register: running_custom_url_categories
name: Print all url categories
debug:
var: item
with_items:
`
Test output:
`
$ ansible-playbook panos.yaml -l --tags url_test --ask-vault-pass
Vault password:
PLAY [panos playbook] **************************************************************************************
*
TASK [panos : load secret vars] ******************************************************************************
*
ok: []
TASK [panos : Get running config url categories] *************************************************************
*
ok: []
TASK [panos : Print all url categories] ************************************************************************
*
ok: [] => (item={'changed': False, 'ansible_module_results': {}, 'objects': [{'url_value': ['cat1.com'], 'description': 'The No 1 category', 'type': 'URL List', 'name': 'custom-url-category-1'}, {'url_value': ['.cat2.com', 'cat2.com', 'cat2.net'], 'description': None, 'type': 'URL List', 'name': 'custom-url-category-2'}, {'url_value': ['.cat3.com', 'host.cat3.com'], 'description': None, 'type': 'URL List', 'name': 'custom-url-category-3'}], 'failed': False}) => {
"ansible_loop_var": "item",
"item": {
"ansible_module_results": {},
"changed": false,
"failed": false,
"objects": [
{
"description": "The No 1 category",
"name": "custom-url-category-1",
"type": "URL List",
"url_value": [
"cat1.com"
]
},
{
"description": null,
"name": "custom-url-category-2",
"type": "URL List",
"url_value": [
".cat2.com",
"cat2.com",
"cat2.net"
]
},
{
"description": null,
"name": "custom-url-category-3",
"type": "URL List",
"url_value": [
".cat3.com",
"host.cat3.com"
]
}
]
}
}
PLAY RECAP **************************************************************************************
*
: ok=3 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
`
Screenshots (if appropriate)
Types of changes
Checklist