Skip to content

Commit 4c224cc

Browse files
fix: All content updated to fit the standard for Ansible Validated Content (#13)
1 parent 1799553 commit 4c224cc

19 files changed

Lines changed: 132 additions & 100 deletions

.ansible-lint.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@ skip_list:
99

1010
exclude_paths:
1111
- mkdocs.yml
12+
- panos_policy_automation/mkdocs.yml
1213
- .github
14+
- panos_policy_automation/.github

.github/workflows/ci.yml

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ defaults:
77

88
on:
99
pull_request:
10-
branches: [ master ]
10+
branches: [master]
1111
jobs:
1212
ansible-syntax:
1313
runs-on: ubuntu-latest
@@ -16,6 +16,8 @@ jobs:
1616
steps:
1717
- name: Checkout code
1818
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
19+
with:
20+
path: "ansible_collections/paloaltonetworks/panos_policy_automation"
1921

2022
- name: Set up Python
2123
uses: actions/setup-python@7f4fc3e22c37d6ff65e88745f38bd3157c663f7c # v4
@@ -33,29 +35,14 @@ jobs:
3335
3436
- name: Ansible lint
3537
run: |
36-
ansible-lint ../ansible_panos_policy_orchestration/ --offline
37-
38-
python-tests:
39-
runs-on: ubuntu-latest
40-
name: Python Filter Tests
41-
42-
steps:
43-
- name: Checkout code
44-
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
45-
46-
- name: Set up Python
47-
uses: actions/setup-python@7f4fc3e22c37d6ff65e88745f38bd3157c663f7c # v4
48-
with:
49-
python-version: "3.11"
50-
51-
- name: Install dependencies
52-
run: |
53-
python -m pip install --upgrade pip
54-
pip install pytest
38+
cd ansible_collections/paloaltonetworks/panos_policy_automation
39+
ls -l
40+
ansible-lint . --offline
5541
56-
- name: Run custom filter tests
42+
- name: Ansible Sanity Tests
5743
run: |
58-
python -m pytest ./plugins/filter/test_custom_filters.py -v
44+
cd ansible_collections/paloaltonetworks/panos_policy_automation
45+
ansible-test sanity --exclude mkdocs.yml
5946
6047
secrets-scan:
6148
runs-on: ubuntu-latest

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
- name: Update Ansible Galaxy file with the next version
5757
run: |
5858
sed -i 's/version\:.*/version: ${{ steps.get_version.outputs.NEXT_VERSION }}/' galaxy.yml
59-
59+
6060
- name: Commit and push galaxy changes
6161
run: |
6262
git config --global user.name 'Github Actions Release Pipeline'
@@ -85,4 +85,4 @@ jobs:
8585
- name: Run semantic-release
8686
env:
8787
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
88-
run: semantic-release
88+
run: semantic-release

.releaserc.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
{
2-
"branches": ["master"],
3-
"plugins": [
4-
"@semantic-release/commit-analyzer",
5-
"@semantic-release/release-notes-generator",
6-
"@semantic-release/changelog",
7-
[
8-
"@semantic-release/git",
9-
{
10-
"assets": ["CHANGELOG.md"],
11-
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
12-
}
13-
],
14-
"@semantic-release/github"
15-
]
1+
{
2+
"branches": ["master"],
3+
"plugins": [
4+
"@semantic-release/commit-analyzer",
5+
"@semantic-release/release-notes-generator",
6+
"@semantic-release/changelog",
7+
[
8+
"@semantic-release/git",
9+
{
10+
"assets": ["CHANGELOG.md"],
11+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
12+
}
13+
],
14+
"@semantic-release/github"
15+
]
1616
}

LICENSE.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
Copyright (c) 2025 abaumeister
2-
3-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4-
5-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6-
1+
Copyright (c) 2025 abaumeister
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
77
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 68 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Ansible PAN-OS Policy Automation
22

33
![GitHub commit activity](https://img.shields.io/github/commit-activity/w/adambaumeister/ansible_panos_policy_orchestration)
4-
![GitHub commits difference between two branches/tags/commits](https://img.shields.io/github/commits-difference/adambaumeister/ansible_panos_policy_orchestration?base=master&head=develop&label=Changes%20Pending%20Release)
5-
![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/adambaumeister/ansible_panos_policy_orchestration/ci.yml)
4+
![GitHub commits difference between two branches/tags/commits](https://img.shields.io/github/commits-difference/paloaltonetworks/ansible_panos_policy_orchestration?base=master&head=develop&label=Changes%20Pending%20Release)
5+
![Ansible Lint/Sanity Checks](https://img.shields.io/github/actions/workflow/status/paloaltonetworks/ansible_panos_policy_orchestration/ci.yml?label=Ansible%20Lint%2FSanity%20Checks)
66
![GitHub License](https://img.shields.io/github/license/adambaumeister/ansible_panos_policy_orchestration)
77
![GitHub Repo stars](https://img.shields.io/github/stars/adambaumeister/ansible_panos_policy_orchestration)
88
![GitHub Release](https://img.shields.io/github/v/release/adambaumeister/ansible_panos_policy_orchestration)
@@ -19,22 +19,43 @@ This repository would be of interest to you if:
1919
* You can make repeatable, actionable policy decisions
2020
* You are comfortable with Ansible or General automation platforms.
2121

22-
## Quickstart
23-
24-
### Requirements
22+
## Requirements
2523

2624
* Python 3.11+
2725
* Ansible 2.16+
2826
* Panorama (this collection does NOT work for standalone firewalls or Strata Cloud Manager)
2927
* NGFWs connected to Panorama must be running Routed mode
3028

31-
### Install this collection
29+
## Installation
30+
31+
Before using this collection, you need to install it with the Ansible Galaxy command-line tool:
3232

3333
```shell
3434
ansible-galaxy install paloaltonetworks.panos_policy_automation
3535
```
3636

37-
### Define your Inventory
37+
You can also include it in a requirements.yml file and install it with ansible-galaxy collection install -r requirements.yml, using the format:
38+
39+
```yaml
40+
collections:
41+
- name: paloaltonetworks.panos_policy_automation
42+
```
43+
44+
To upgrade the collection to the latest available version, run the following command:
45+
46+
```
47+
ansible-galaxy collection install paloaltonetworks.panos_policy_automation --upgrade
48+
```
49+
50+
You can also install a specific version of the collection. Use the following syntax to install version 1.0.0:
51+
52+
```
53+
ansible-galaxy collection install paloaltonetworks.panos_policy_automation:==1.0.0
54+
```
55+
56+
See [using Ansible collections](https://docs.ansible.com/ansible/devel/user_guide/collections_using.html) for more details.
57+
58+
### Post-Installation Configuration
3859

3960
In this example, we are defining one panorama host under "lab".
4061

@@ -136,15 +157,52 @@ Note, replace the playbook and vars file names with your versions.
136157
ansible-playbook your_playbook.yml -i inventory.yml --extra-vars=@vars_file.yml
137158
```
138159

139-
## Need help?
160+
## Use Cases
161+
162+
**Automatically updating Object Groups**
163+
164+
Transforming requests for policy to new network objects.
165+
166+
**Automatically creating policy at preset locations**
167+
168+
Deploying new security rules to the bottom, top, or at a preset location such as "after this rule".
169+
170+
## Testing
171+
172+
This collection has been tested in lab environments with the following specs:
173+
174+
| product | version |
175+
|-----------------|---------------------------|
176+
| Panorama | 11.2.3-h3 |
177+
| vm-series | 11.2.3-h3 |
178+
| mode | routed |
179+
| router type | virtual (legacy, not ARE) |
180+
| Total Firewalls | 1 |
181+
182+
183+
## Support
184+
185+
For support, please raise a [Github issue](https://github.com/PaloAltoNetworks/ansible_panos_policy_orchestration/issues. This collection is supported by PaloAltoNetworks on a **best effort basis**
186+
only. For more detailed support, including deployment help, contact Palo Alto Networks Professional Services.
187+
188+
## Release Notes and Roadmap
189+
190+
View the [Releases](https://github.com/PaloAltoNetworks/ansible_panos_policy_orchestration/releases) page for a detailed
191+
changelog.
192+
193+
## Related Information
140194

141195
Read the [docs](https://paloaltonetworks.github.io/ansible_panos_policy_orchestration/) for more information.
142196

197+
## License Information
198+
199+
https://github.com/PaloAltoNetworks/ansible_panos_policy_orchestration/blob/master/LICENSE.md
200+
143201
## Responsible AI Assistance Disclosure
144202

145-
Generative AI through the use of large language models has been used selectively in this repository
203+
Generative AI, through the use of large language models, has been used selectively in this repository
146204
in the following ways:
147205

148206
1. Creating or editing documentation
149-
2. Refactoring modules
207+
2. Refactoring modules (such as changing parent path)
150208
3. Creation of unit tests

plugins/filter/panos_op_get_zone_from_interface.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/python
2-
31
DOCUMENTATION = '''
42
name: panos_op_get_zone_from_interface
53
short_description: Get security zone from interface names
@@ -54,7 +52,6 @@
5452
'''
5553

5654
from xml.etree.ElementTree import fromstring
57-
from typing import Union
5855

5956

6057
def panos_op_get_zone_from_interface(data, interface_names):
@@ -79,4 +76,4 @@ class FilterModule(object):
7976
def filters(self):
8077
return {
8178
'panos_op_get_zone_from_interface': panos_op_get_zone_from_interface
82-
}
79+
}

plugins/filter/panos_op_policy_match_result_to_bool.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/usr/bin/python
21

32
DOCUMENTATION = '''
43
name: panos_op_policy_match_result_to_bool
@@ -60,7 +59,6 @@
6059

6160
import json
6261
from json import JSONDecodeError
63-
from typing import Union
6462

6563

6664
def panos_op_policy_match_result_to_bool(data):
@@ -86,4 +84,4 @@ class FilterModule(object):
8684
def filters(self):
8785
return {
8886
'panos_op_policy_match_result_to_bool': panos_op_policy_match_result_to_bool
89-
}
87+
}

plugins/filter/panos_op_routing_result_to_interfaces.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/usr/bin/python
21

32
DOCUMENTATION = '''
43
name: panos_op_routing_result_to_interfaces
@@ -47,7 +46,6 @@
4746
'''
4847

4948
import json
50-
from typing import Union
5149

5250

5351
def panos_op_routing_result_to_interfaces(results):
@@ -68,4 +66,4 @@ class FilterModule(object):
6866
def filters(self):
6967
return {
7068
'panos_op_routing_result_to_interfaces': panos_op_routing_result_to_interfaces
71-
}
69+
}

plugins/filter/panos_op_stdout_results_to_list.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/usr/bin/python
21

32
DOCUMENTATION = '''
43
name: panos_op_stdout_results_to_list
@@ -41,7 +40,6 @@
4140
'''
4241

4342
import json
44-
from typing import Union
4543

4644

4745
def panos_op_stdout_results_to_list(data):
@@ -61,4 +59,4 @@ class FilterModule(object):
6159
def filters(self):
6260
return {
6361
'panos_op_stdout_results_to_list': panos_op_stdout_results_to_list
64-
}
62+
}

0 commit comments

Comments
 (0)