Skip to content

Commit dc2d093

Browse files
chore: Add EE environment details
1 parent b7cd960 commit dc2d093

5 files changed

Lines changed: 89 additions & 2 deletions

File tree

.github/workflows/ee.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
name: CI
3+
4+
defaults:
5+
run:
6+
shell: bash
7+
8+
on:
9+
push:
10+
branches:
11+
- feat/ansible-ee
12+
13+
env:
14+
PYTHON_VERSION: 3.12
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: read
21+
packages: write
22+
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
26+
with:
27+
path: "ansible_collections/paloaltonetworks/panos_policy_automation"
28+
29+
- name: Set up Python
30+
uses: actions/setup-python@7f4fc3e22c37d6ff65e88745f38bd3157c663f7c # v4
31+
with:
32+
python-version: $PYTHON_VERSION
33+
34+
- name: Install Ansible Builder
35+
run: |
36+
python -m pip install --upgrade pip
37+
pip install ansible-builder
38+
39+
- name: Build docker context
40+
run: |
41+
ansible-builder create -f meta/execution-environment.yml
42+
43+
- name: login to GHCR
44+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 #v3
45+
with:
46+
registry: ghcr.io
47+
username: ${{ github.actor }}
48+
password: ${{ secrets.GITHUB_TOKEN }}
49+
50+
- name: build and publish
51+
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5
52+
with:
53+
context: "./context/"
54+
push: true
55+
tags: ${{ github.ref_name }}
56+
#labels: ${{ steps.meta.outputs.labels }}
57+
cache-from: type=gha
58+
cache-to: type=gha,mode=max
59+
provenance: ${{ inputs.release }}

.github/workflows/release_to_galaxy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name: Release to Ansible repositories
44
on:
55
push:
66
tags:
7-
- 'v[0-9]+.[0-9]+.[0-9]+' # Matches tags like v1.0.0, v2.1.5, etc. Note currently is not triggered by semantic release
7+
- 'v[0-9]+.[0-9]+.[0-9]+' # Matches tags like v1.0.0, v2.1.5, etc. This CI gets triggered by Semantic release.
88
workflow_dispatch:
99
permissions:
1010
contents: write

docs/user_guide/demo_walkthrough.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,13 @@ CCTV
1919

2020
Example Web to DB
2121

22+
Run the lookup first
2223
```shell
23-
ansible-playbook -i inventory_real.yml --extra-vars=@example_vars_file_web_to_db.yml example_playbook.yml
24+
ansible-playbook -i inventory_real.yml --extra-vars=@./example_vars_file_web_to_db.yml paloaltonetworks.panos_policy_automation.examples.lookup_policy
2425
```
2526

27+
Then, run creation
28+
29+
```shell
30+
ansible-playbook -i inventory_real.yml --extra-vars=@./example_vars_file_web_to_db.yml paloaltonetworks.panos_policy_automation.examples.create_policy
31+
```

meta/ee-requirements.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
netaddr>=1.3.0
2+
dpath>=2.1.5,<3.0 ; python_version >= "3.10" and python_version < "4.0"
3+
pan-os-python>=1.8,<2.0 ; python_version >= "3.10" and python_version < "4.0"
4+
panos-upgrade-assurance>=1.4,<2.0 ; python_version >= "3.10" and python_version < "4.0"
5+
xmltodict>=0.12.0,<0.15.0 ; python_version >= "3.10" and python_version < "4.0"

meta/execution-environment.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
version: 3
3+
dependencies:
4+
python: ee-requirements.txt
5+
galaxy:
6+
collections:
7+
- community.general
8+
- name: ansible.posix
9+
- name: ansible.utils
10+
- name: paloaltonetworks.panos_policy_automation
11+
ansible_core:
12+
package_pip: ansible-core==2.19.3
13+
images:
14+
base_image:
15+
name: docker.io/redhat/ubi9:latest
16+
build_arg_defaults:
17+
ANSIBLE_GALAXY_CLI_COLLECTION_OPTS: '--ignore-certs'

0 commit comments

Comments
 (0)