Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .config/ansible-lint.yml → .ansible-lint
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
profile: production
strict: true
skip_list:
- ignore-errors # Use failed_when and specify error conditions instead of using ignore_errors.
- meta-no-info # meta/main.yml should contain relevant info.
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,3 @@ on:
jobs:
linters:
uses: ansible-network/github_actions/.github/workflows/tox-linters.yml@main
ansible-lint:
runs-on: ubuntu-latest
steps:
- uses: ansible-network/github_actions/.github/actions/checkout_dependency@main

- name: run-ansible-lint
uses: ansible/ansible-lint@v25.1.2
20 changes: 20 additions & 0 deletions .github/workflows/sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,38 @@ jobs:
"ansible-version": "milestone",
"python-version": "3.10"
},
{
"ansible-version": "stable-2.20",
"python-version": "3.10"
},
{
"ansible-version": "stable-2.20",
"python-version": "3.11"
},
{
"ansible-version": "stable-2.19",
"python-version": "3.10"
},

"ansible-version": "stable-2.19",
"python-version": "3.14"
},
{
"ansible-version": "stable-2.18",
"python-version": "3.10"
},
{
"ansible-version": "stable-2.18",
"python-version": "3.14"
},
{
"ansible-version": "stable-2.17",
"python-version": "3.13"
},
{
"ansible-version": "stable-2.17",
"python-version": "3.14"
},
{
"ansible-version": "stable-2.16"
}
Expand Down
4 changes: 2 additions & 2 deletions galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ tags:
- infrastructure
- cluster
dependencies:
amazon.aws: '>=5.1.0'
community.aws: '>=5.0.0'
amazon.aws: '>=10.0.0,<12.0.0-dev0'
community.aws: '>=10.0.0,<12.0.0-dev0'
amazon.cloud: '>=0.4.0'
community.libvirt: '>=1.2.0'
version: 5.0.0-dev0
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/validate_network_acls.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@
sample: 'Network ACL validation successful'
"""

from ipaddress import ip_network, ip_address
from collections import namedtuple
from ansible.module_utils.basic import AnsibleModule
from ipaddress import ip_address, ip_network

from ansible.module_utils.basic import AnsibleModule

# NACL Entry format
# [
Expand Down
8 changes: 4 additions & 4 deletions plugins/modules/validate_route_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
interface_id: null
network_interface_id: null
origin: "CreateRoute"
state": "active"
state: "active"
vpc_id: "vpc-0bee28efef41e1de4"
dest_vpc_route_tables:
- associations:
Expand Down Expand Up @@ -166,7 +166,7 @@
interface_id: null
network_interface_id: null
origin: "CreateRoute"
state": "active"
state: "active"
vpc_id: "vpc-0bee28efef41e1de4"
src_subnets:
- assign_ipv6_address_on_creation: false
Expand All @@ -184,7 +184,7 @@
owner_id: "00000000000"
private_dns_name_options_on_launch:
enable_resource_name_dns_a_record: false
enable_resource_name_dns_aaaa_record": false
enable_resource_name_dns_aaaa_record: false
hostname_type: "ip-name"
state: "available"
subnet_arn: "arn:aws:ec2:eu-west-2:721066863947:subnet/subnet-0af56e0d353f88cb8"
Expand Down Expand Up @@ -260,8 +260,8 @@
sample: 'Route table validation successful'
"""

from ipaddress import ip_network
import copy
from ipaddress import ip_network

from ansible.module_utils.basic import AnsibleModule

Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/validate_security_group_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@
sample: 'Security Group validation successful'
"""

from ipaddress import ip_network, ip_address
import copy
from ipaddress import ip_address, ip_network

from ansible.module_utils.basic import AnsibleModule

Expand Down
67 changes: 52 additions & 15 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,36 +1,73 @@
[tox]
minversion = 1.4.2
minversion = 4.0
skipsdist = True

[common]
format_dirs = {toxinidir}/plugins {toxinidir}/tests

[testenv]
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
deps = -r {toxinidir}/test-requirements.txt
install_command = pip install {opts} {packages}

[testenv:black]
[testenv:ansible-lint]
description = Run ansible-lint
deps =
black >= 23.0, < 24.0
ansible-lint >= 25.1.2
commands = ansible-lint

[testenv:black]
description = Lint against "black" formatting standards
deps =
black >= 24.0, < 25.0
commands =
black {toxinidir}/plugins {toxinidir}/tests
black --check --diff {[common]format_dirs}

[testenv:ansible-lint]
[testenv:black_format]
description = Apply "black" formatting
deps =
ansible-lint >= 25.1.2
changedir = {toxinidir}
{[testenv:black]deps}
commands =
ansible-lint
black -v {[common]format_dirs}

[testenv:linters]
[testenv:flake8]
deps =
yamllint
flake8
commands =
flake8 {[common]format_dirs}

[testenv:isort]
description = Lint for import sorting
deps =
isort
commands =
isort --check-only --diff {[common]format_dirs}

[testenv:isort_format]
description = Sort imports
deps =
{[testenv:isort]deps}
commands =
isort -v {[common]format_dirs}

[testenv:format]
deps =
{[testenv:black]deps}
{[testenv:isort]deps}
commands =
{[testenv:black]commands}
{[testenv:isort]commands}

[testenv:linters]
deps =
{[testenv:black]deps}
{[testenv:flake8]deps}
{[testenv:isort]deps}
{[testenv:ansible-lint]deps}
commands =
black -v --check --diff {toxinidir}/plugins {toxinidir}/tests
yamllint -s {toxinidir}
flake8 {toxinidir}
{[testenv:black]commands}
{[testenv:flake8]commands}
{[testenv:isort]commands}
{[testenv:ansible-lint]commands}

[testenv:sanity]
deps = ansible
Expand Down