Skip to content

Commit

Permalink
fix: Fixed linter workflow and documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
willguibr committed Apr 23, 2024
1 parent 5b2bf61 commit 093c9ad
Show file tree
Hide file tree
Showing 22 changed files with 100 additions and 335 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/ansible-test-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Ansible Lint

on:
push:
branches: [master]
pull_request:
branches: [master]
schedule:
- cron: '0 14 * * 1-5' # UTC
workflow_dispatch:


env:
NAMESPACE: zscaler
COLLECTION_NAME: ziacloud
PYTHON_VERSION: 3.8

jobs:

# Ansible-lint is a requirement for certification, and was added to the
# certification pipeline 20 June 2023 per Ansible Partner Engineering
# communication emails
#
# Config file is .ansible-lint
lint:
name: Ansible Lint
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./ansible_collections/${{ env.NAMESPACE }}/${{ env.COLLECTION_NAME }}
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Run ansible-lint
uses: ansible/ansible-lint@main
9 changes: 4 additions & 5 deletions plugins/modules/zia_authentication_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,13 @@
"""

EXAMPLES = """
- name: Create/Update/Delete URLs
zscaler.ziacloud.zia_authentication_settings:
urls:
- .okta.com
- .oktacdn.com
- .mtls.oktapreview.com
- .mtls.okta.com
- .okta.com
- .oktacdn.com
- .mtls.oktapreview.com
- .mtls.okta.com
"""

RETURN = r"""
Expand Down
12 changes: 6 additions & 6 deletions plugins/modules/zia_cloud_firewall_ip_destination_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,13 @@
"""

EXAMPLES = r"""
- name: Create/Update/Delete ip destination group - DSTN_FQDN.
zscaler.ziacloud.zia_cloud_firewall_ip_destination_groups:
provider: '{{ provider }}'
name: "Example"
description: "Example"
type: "DSTN_FQDN"
addresses: [ "test1.acme.com", "test2.acme.com", "test3.acme.com" ]
addresses: ["test1.acme.com", "test2.acme.com", "test3.acme.com"]
- name: Create/Update/Delete ip destination group - DSTN_IP by Country.
zscaler.ziacloud.zia_cloud_firewall_ip_destination_groups:
Expand All @@ -124,10 +123,11 @@
name: "Example - IP Ranges"
description: "Example - IP Ranges"
type: "DSTN_IP"
addresses: [ "3.217.228.0-3.217.231.255",
"3.235.112.0-3.235.119.255",
"52.23.61.0-52.23.62.25",
"35.80.88.0-35.80.95.255" ]
addresses:
- "3.217.228.0-3.217.231.255"
- "3.235.112.0-3.235.119.255"
- "52.23.61.0-52.23.62.25"
- "35.80.88.0-35.80.95.255"
"""

RETURN = r"""
Expand Down
7 changes: 3 additions & 4 deletions plugins/modules/zia_cloud_firewall_ip_source_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,15 @@
"""

EXAMPLES = r"""
- name: Create/Update/Delete ip source group.
zscaler.ziacloud.zia_cloud_firewall_ip_source_groups:
provider: '{{ provider }}'
name: "Example"
description: "Example"
ip_addresses:
- 192.168.1.1
- 192.168.1.2
- 192.168.1.3
- 192.168.1.1
- 192.168.1.2
- 192.168.1.3
"""

RETURN = r"""
Expand Down
22 changes: 11 additions & 11 deletions plugins/modules/zia_cloud_firewall_network_application_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,17 @@
provider: '{{ provider }}'
name: "sampleNetworkApplicationGroup"
network_applications:
- 'YAMMER'
- 'OFFICE365'
- 'SKYPE_FOR_BUSINESS'
- 'OUTLOOK'
- 'SHAREPOINT'
- 'SHAREPOINT_ADMIN'
- 'SHAREPOINT_BLOG'
- 'SHAREPOINT_CALENDAR'
- 'SHAREPOINT_DOCUMENT'
- 'SHAREPOINT_ONLINE'
- 'ONEDRIVE'
- 'YAMMER'
- 'OFFICE365'
- 'SKYPE_FOR_BUSINESS'
- 'OUTLOOK'
- 'SHAREPOINT'
- 'SHAREPOINT_ADMIN'
- 'SHAREPOINT_BLOG'
- 'SHAREPOINT_CALENDAR'
- 'SHAREPOINT_DOCUMENT'
- 'SHAREPOINT_ONLINE'
- 'ONEDRIVE'
"""

RETURN = r"""
Expand Down
9 changes: 4 additions & 5 deletions plugins/modules/zia_cloud_firewall_network_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,13 +208,12 @@
name: "example"
description: "example"
src_tcp_ports:
- start: 5002
end: 5005
- start: 5002
end: 5005
dest_tcp_ports:
- start: 5003
end: 5005
- start: 5003
end: 5005
type: "CUSTOM"
"""

RETURN = r"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,13 @@
"""

EXAMPLES = r"""
- name: Create/Update/Delete Network Services Groups.
zscaler.ziacloud.zia_cloud_firewall_network_services_groups:
provider: '{{ provider }}'
name: "example"
description: "example"
services:
- name: [ "UDP_ANY", "TCP_ANY" ]
- name: ["UDP_ANY", "TCP_ANY"]
"""

RETURN = r"""
Expand Down
12 changes: 6 additions & 6 deletions plugins/modules/zia_location_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@
required: false
"""

EXAMPLES = """
EXAMPLES = r"""
- name: Create UFQDN VPN Credential.
zscaler.ziacloud.zia_traffic_forwarding_vpn_credentials:
type: "UFQDN"
Expand All @@ -265,8 +265,8 @@
ofw_enabled: true
ips_control: true
vpn_credentials:
- id: "{{ vpn_credential_ufqdn.data.id }}"
type: "{{ vpn_credential_ufqdn.data.type }}"
- id: "{{ vpn_credential_ufqdn.data.id }}"
type: "{{ vpn_credential_ufqdn.data.type }}"
# Create Location Management with VPN IP Type
- name: Create/Update/Delete a Static IP.
Expand Down Expand Up @@ -303,9 +303,9 @@
ips_control: true
ip_addresses: "static_ip.data.ip_address"
vpn_credentials:
- id: "{{ vpn_credential_ip.data.id }}"
type: "{{ vpn_credential_ip.data.type }}"
ip_address: "{{ vpn_credential_ip.data.ip_address }}"
- id: "{{ vpn_credential_ip.data.id }}"
type: "{{ vpn_credential_ip.data.type }}"
ip_address: "{{ vpn_credential_ip.data.ip_address }}"
"""

RETURN = """
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/zia_sandbox_submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
zscaler.ziacloud.zia_sandbox_submission:
provider: '{{ provider }}'
file_path: "/path/to/malware.exe"
force: True
force: true
inspection_mode: sandbox
- name: Submit a file for analysis.
Expand Down
1 change: 0 additions & 1 deletion plugins/modules/zia_traffic_forwarding_gre_tunnel_facts.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
zscaler.ziacloud.zia_traffic_forwarding_gre_tunnel_facts:
provider: '{{ provider }}'
id: 82709
"""

RETURN = r"""
Expand Down
8 changes: 4 additions & 4 deletions plugins/modules/zia_traffic_forwarding_gre_tunnels.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@
ip_unnumbered: true
within_country: true
primary_dest_vip:
- id:
virtual_ip:
- id:
virtual_ip:
secondary_dest_vip:
- id:
virtual_ip:
- id:
virtual_ip:
"""

RETURN = r"""
Expand Down
1 change: 0 additions & 1 deletion plugins/modules/zia_traffic_forwarding_static_ip_facts.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
zscaler.ziacloud.zia_traffic_forwarding_static_ip_facts:
provider: '{{ provider }}'
id: 82709
"""

RETURN = r"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
zscaler.ziacloud.zia_traffic_forwarding_vpn_credentials_facts:
provider: '{{ provider }}'
id: 222
"""


Expand Down
28 changes: 14 additions & 14 deletions plugins/modules/zia_url_categories.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,23 +159,23 @@
description: Example_Category
type: URL_CATEGORY
keywords:
- microsoft
- microsoft
custom_category: true
db_categorized_urls:
- .creditkarma.com
- .youku.com
- .creditkarma.com
- .youku.com
urls:
- .coupons.com
- .resource.alaskaair.net
- .techrepublic.com
- .dailymotion.com
- .osiriscomm.com
- .uefa.com
- .Logz.io
- .alexa.com
- .baidu.com
- .cnn.com
- .level3.com
- .coupons.com
- .resource.alaskaair.net
- .techrepublic.com
- .dailymotion.com
- .osiriscomm.com
- .uefa.com
- .Logz.io
- .alexa.com
- .baidu.com
- .cnn.com
- .level3.com
"""

RETURN = r"""
Expand Down
22 changes: 11 additions & 11 deletions plugins/modules/zia_url_filtering_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,18 +336,18 @@
action: "ALLOW"
order: 1
protocols:
- "HTTPS_RULE"
- "HTTP_RULE"
- "HTTPS_RULE"
- "HTTP_RULE"
request_methods:
- "CONNECT"
- "DELETE"
- "GET"
- "HEAD"
- "OPTIONS"
- "OTHER"
- "POST"
- "PUT"
- "TRACE"
- "CONNECT"
- "DELETE"
- "GET"
- "HEAD"
- "OPTIONS"
- "OTHER"
- "POST"
- "PUT"
- "TRACE"
"""

RETURN = r"""
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 093c9ad

Please sign in to comment.