diff --git a/.ansible-lint b/.ansible-lint new file mode 100644 index 0000000..a67ade1 --- /dev/null +++ b/.ansible-lint @@ -0,0 +1,6 @@ +--- +profile: production +exclude_paths: + - .ansible/ + - .github/ + - tests/integration diff --git a/.config/ansible-lint.yml b/.config/ansible-lint.yml deleted file mode 100644 index f570091..0000000 --- a/.config/ansible-lint.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -profile: production -strict: true -exclude_paths: - - changelogs/changelog.yaml - - tests/integration -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. diff --git a/.github/workflows/linters.yaml b/.github/workflows/linters.yaml index cf2b797..66a231d 100644 --- a/.github/workflows/linters.yaml +++ b/.github/workflows/linters.yaml @@ -12,13 +12,5 @@ on: - stable-* jobs: - ansible-lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: run-ansible-lint - uses: ansible/ansible-lint@v25.1.2 - tox-linters: uses: ansible-network/github_actions/.github/workflows/tox-linters.yml@main diff --git a/.github/workflows/sanity-tests.yaml b/.github/workflows/sanity-tests.yaml index 277ac83..fef5c59 100644 --- a/.github/workflows/sanity-tests.yaml +++ b/.github/workflows/sanity-tests.yaml @@ -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" } diff --git a/changelogs/changelog.yaml b/changelogs/changelog.yaml index de95f56..0565ecc 100644 --- a/changelogs/changelog.yaml +++ b/changelogs/changelog.yaml @@ -3,132 +3,132 @@ releases: 1.0.1: changes: minor_changes: - - various playbooks - minor linting fixes (https://github.com/ansible-collections/cloud.aws_troubleshooting/pull/6). - - various plugins - formating using black (https://github.com/ansible-collections/cloud.aws_troubleshooting/pull/6). - - various roles - minor linting fixes (https://github.com/ansible-collections/cloud.aws_troubleshooting/pull/6). - - various tests - minor linting fixes (https://github.com/ansible-collections/cloud.aws_troubleshooting/pull/6). + - various playbooks - minor linting fixes (https://github.com/ansible-collections/cloud.aws_troubleshooting/pull/6). + - various plugins - formating using black (https://github.com/ansible-collections/cloud.aws_troubleshooting/pull/6). + - various roles - minor linting fixes (https://github.com/ansible-collections/cloud.aws_troubleshooting/pull/6). + - various tests - minor linting fixes (https://github.com/ansible-collections/cloud.aws_troubleshooting/pull/6). release_summary: Re-release 1.0.0 with updated README and generated CHNAGELOG, initial release of the collection fragments: - - 1_0_1_release.yml - - linting.yml + - 1_0_1_release.yml + - linting.yml release_date: '2022-11-11' 1.0.2: changes: minor_changes: - - various playbooks - minor linting fixes (https://github.com/ansible-collections/cloud.aws_troubleshooting/pull/6). - - various plugins - formating using black (https://github.com/ansible-collections/cloud.aws_troubleshooting/pull/6). - - various roles - minor linting fixes (https://github.com/ansible-collections/cloud.aws_troubleshooting/pull/6). - - various tests - minor linting fixes (https://github.com/ansible-collections/cloud.aws_troubleshooting/pull/6). + - various playbooks - minor linting fixes (https://github.com/ansible-collections/cloud.aws_troubleshooting/pull/6). + - various plugins - formating using black (https://github.com/ansible-collections/cloud.aws_troubleshooting/pull/6). + - various roles - minor linting fixes (https://github.com/ansible-collections/cloud.aws_troubleshooting/pull/6). + - various tests - minor linting fixes (https://github.com/ansible-collections/cloud.aws_troubleshooting/pull/6). fragments: - - linting.yml + - linting.yml release_date: '2022-11-16' 1.0.3: changes: bugfixes: - - Fix collection FQCN name issue for role troubleshooting_rds_connectivity (https://github.com/redhat-cop/cloud.aws_troubleshooting/pull/13). + - Fix collection FQCN name issue for role troubleshooting_rds_connectivity (https://github.com/redhat-cop/cloud.aws_troubleshooting/pull/13). fragments: - - multiple-renaming.yml + - multiple-renaming.yml release_date: '2023-03-17' 2.0.0: changes: breaking_changes: - - Remove support for ansible-core < 2.14 (https://github.com/redhat-cop/cloud.aws_troubleshooting/pull/33). - - roles/aws_setup_credentials - Due to ansible-lint issue, the AWS generated - credentials are now stored into variable ``aws_setup_credentials__output`` - instead of ``aws_role_credentials`` (https://github.com/redhat-cop/cloud.aws_troubleshooting/pull/24). - - roles/connectivity_troubleshooter_validate - Due to ansible-lint issue, the - next hop information are now stored into variable ``connectivity_troubleshooter_validate__next_hop`` - instead of ``next_hop`` (https://github.com/redhat-cop/cloud.aws_troubleshooting/pull/24). + - Remove support for ansible-core < 2.14 (https://github.com/redhat-cop/cloud.aws_troubleshooting/pull/33). + - roles/aws_setup_credentials - Due to ansible-lint issue, the AWS generated + credentials are now stored into variable ``aws_setup_credentials__output`` + instead of ``aws_role_credentials`` (https://github.com/redhat-cop/cloud.aws_troubleshooting/pull/24). + - roles/connectivity_troubleshooter_validate - Due to ansible-lint issue, the + next hop information are now stored into variable ``connectivity_troubleshooter_validate__next_hop`` + instead of ``next_hop`` (https://github.com/redhat-cop/cloud.aws_troubleshooting/pull/24). bugfixes: - - roles/connectivity_troubleshooter_igw - fix issue wen calling module ``cloud.aws_troubleshooting.eval_src_igw_route`` - with wrong value for parameters ``src_subnet_id`` and ``src_network_interface`` - (https://github.com/redhat-cop/cloud.aws_troubleshooting/pull/29). - - roles/connectivity_troubleshooter_local - fix issue when using wrong value - for source subnet id, should be ``connectivity_troubleshooter_local__src_subnet_id`` - instead of ``src_subnet_id`` and for destination subnet id, should be ``connectivity_troubleshooter_local__dst_subnet_id`` - instead of ``dst_subnet_id`` (https://github.com/redhat-cop/cloud.aws_troubleshooting/pull/29). - - roles/connectivity_troubleshooter_nat - fix issue when using wrong value for - source subnet id, should be ``connectivity_troubleshooter_nat__src_subnet_id`` - instead of ``src_subnet_id`` and add missing steps to gather information about - NAT subnet network ACLs and source ENI (https://github.com/redhat-cop/cloud.aws_troubleshooting/pull/29). + - roles/connectivity_troubleshooter_igw - fix issue wen calling module ``cloud.aws_troubleshooting.eval_src_igw_route`` + with wrong value for parameters ``src_subnet_id`` and ``src_network_interface`` + (https://github.com/redhat-cop/cloud.aws_troubleshooting/pull/29). + - roles/connectivity_troubleshooter_local - fix issue when using wrong value + for source subnet id, should be ``connectivity_troubleshooter_local__src_subnet_id`` + instead of ``src_subnet_id`` and for destination subnet id, should be ``connectivity_troubleshooter_local__dst_subnet_id`` + instead of ``dst_subnet_id`` (https://github.com/redhat-cop/cloud.aws_troubleshooting/pull/29). + - roles/connectivity_troubleshooter_nat - fix issue when using wrong value for + source subnet id, should be ``connectivity_troubleshooter_nat__src_subnet_id`` + instead of ``src_subnet_id`` and add missing steps to gather information about + NAT subnet network ACLs and source ENI (https://github.com/redhat-cop/cloud.aws_troubleshooting/pull/29). minor_changes: - - roles/aws_setup_credentials - add ``no_log=true`` when setting credentials - (https://github.com/redhat-cop/cloud.aws_troubleshooting/pull/29). + - roles/aws_setup_credentials - add ``no_log=true`` when setting credentials + (https://github.com/redhat-cop/cloud.aws_troubleshooting/pull/29). release_summary: This major release drops support for ansible-core versions lower than 2.14 and Python versions lower than 3.9. fragments: - - 20230426-update_readme_and_runtime.yml - - 20230907_multiple_fixes.yaml - - 20231018-add-integration-test-for-role-troubleshoot_rds_connectivity.yml - - 20231020-update_docs.yaml - - 20231113-update_supported_versions.yaml - - ansible_lint_sanity_fixes.yml - - automation_hub_update_readme.yaml - - fix_sanity_issues.yaml + - 20230426-update_readme_and_runtime.yml + - 20230907_multiple_fixes.yaml + - 20231018-add-integration-test-for-role-troubleshoot_rds_connectivity.yml + - 20231020-update_docs.yaml + - 20231113-update_supported_versions.yaml + - ansible_lint_sanity_fixes.yml + - automation_hub_update_readme.yaml + - fix_sanity_issues.yaml release_date: '2023-11-21' 3.0.0: changes: breaking_changes: - - Bump minimum version requirement for ansible-core to 2.15 (https://github.com/redhat-cop/cloud.aws_troubleshooting/pull/36). + - Bump minimum version requirement for ansible-core to 2.15 (https://github.com/redhat-cop/cloud.aws_troubleshooting/pull/36). minor_changes: - - Bump version of ansible-lint to minimum 24.7.0 (https://github.com/redhat-cop/cloud.aws_troubleshooting/pull/36). + - Bump version of ansible-lint to minimum 24.7.0 (https://github.com/redhat-cop/cloud.aws_troubleshooting/pull/36). release_summary: This release removes support for ansible-core < 2.15. fragments: - - 3.0.0.yml - - 36-bump-ansible-lint-version.yml - - readme_template_update.yml + - 3.0.0.yml + - 36-bump-ansible-lint-version.yml + - readme_template_update.yml release_date: '2024-07-30' 4.0.0: changes: breaking_changes: - - Support for ansible-core < 2.17 has been dropped - - 'setup_aws_credentials - Support for the ``EC2_ACCESS_KEY`` environment variable - has been removed in the latest major release of amazon.aws 10.0.0 and removed - from this role. Please use the ``aws_access_key`` parameter or ``AWS_ACCESS_KEY_ID`` - environment variable instead. (https://github.com/redhat-cop/cloud.aws_troubleshooting/pull/45) + - Support for ansible-core < 2.17 has been dropped + - 'setup_aws_credentials - Support for the ``EC2_ACCESS_KEY`` environment variable + has been removed in the latest major release of amazon.aws 10.0.0 and removed + from this role. Please use the ``aws_access_key`` parameter or ``AWS_ACCESS_KEY_ID`` + environment variable instead. (https://github.com/redhat-cop/cloud.aws_troubleshooting/pull/45) - ' - - 'setup_aws_credentials - Support for the ``EC2_REGION`` environment variable - has been removed in the latest major release of amazon.aws 10.0.0 and removed - from this role. Please use the ``region`` parameter or ``AWS_REGION`` environment - variable instead. (https://github.com/redhat-cop/cloud.aws_troubleshooting/pull/45) + ' + - 'setup_aws_credentials - Support for the ``EC2_REGION`` environment variable + has been removed in the latest major release of amazon.aws 10.0.0 and removed + from this role. Please use the ``region`` parameter or ``AWS_REGION`` environment + variable instead. (https://github.com/redhat-cop/cloud.aws_troubleshooting/pull/45) - ' - - 'setup_aws_credentials - Support for the ``EC2_SECRET_KEY`` environment variable - has been removed in the latest major release of amazon.aws 10.0.0 and removed - from this role.Please use the ``aws_secret_key`` parameter or ``AWS_SECRET_ACCESS_KEY`` - environment variable instead. (https://github.com/redhat-cop/cloud.aws_troubleshooting/pull/45) + ' + - 'setup_aws_credentials - Support for the ``EC2_SECRET_KEY`` environment variable + has been removed in the latest major release of amazon.aws 10.0.0 and removed + from this role.Please use the ``aws_secret_key`` parameter or ``AWS_SECRET_ACCESS_KEY`` + environment variable instead. (https://github.com/redhat-cop/cloud.aws_troubleshooting/pull/45) - ' - - 'setup_aws_credentials - Support for the ``EC2_SECURITY_TOKEN`` and the ``AWS_SECURITY_TOKEN`` - environment variable has been removed in the latest major release of amazon.aws - 10.0.0 and removed from this role. Please use the ``aws_session_token`` parameter - or ``AWS_SESSION_TOKEN`` environment variable instead. (https://github.com/redhat-cop/cloud.aws_troubleshooting/pull/45) + ' + - 'setup_aws_credentials - Support for the ``EC2_SECURITY_TOKEN`` and the ``AWS_SECURITY_TOKEN`` + environment variable has been removed in the latest major release of amazon.aws + 10.0.0 and removed from this role. Please use the ``aws_session_token`` parameter + or ``AWS_SESSION_TOKEN`` environment variable instead. (https://github.com/redhat-cop/cloud.aws_troubleshooting/pull/45) - ' - - 'setup_aws_credentials - Support for the ``EC2_URL_TOKEN`` environment variable - has been removed in the latest major release of amazon.aws 10.0.0 and removed - from this role. Please use the ``aws_endpoint_url`` parameter or ``AWS_URL`` - environment variable instead. (https://github.com/redhat-cop/cloud.aws_troubleshooting/pull/45) + ' + - 'setup_aws_credentials - Support for the ``EC2_URL_TOKEN`` environment variable + has been removed in the latest major release of amazon.aws 10.0.0 and removed + from this role. Please use the ``aws_endpoint_url`` parameter or ``AWS_URL`` + environment variable instead. (https://github.com/redhat-cop/cloud.aws_troubleshooting/pull/45) - ' + ' bugfixes: - - 'Fix integration tests to work with ansible-core 2.19. (https://github.com/redhat-cop/cloud.aws_troubleshooting/pull/45) + - 'Fix integration tests to work with ansible-core 2.19. (https://github.com/redhat-cop/cloud.aws_troubleshooting/pull/45) - ' + ' minor_changes: - - Bump version of ansible-lint to 25.1.2 (https://github.com/redhat-cop/cloud.aws_troubleshooting/pull/42). - - 'documentation - Update playbooks and roles documentation to provide updated - information. (https://github.com/redhat-cop/cloud.aws_troubleshooting/pull/45) + - Bump version of ansible-lint to 25.1.2 (https://github.com/redhat-cop/cloud.aws_troubleshooting/pull/42). + - 'documentation - Update playbooks and roles documentation to provide updated + information. (https://github.com/redhat-cop/cloud.aws_troubleshooting/pull/45) - ' + ' release_summary: Support for certain environment variables has been removed. The versions of ansible-core, ansible-lint, amazon.aws, and community.aws have been updated. fragments: - - 4.0.0-increase_ansible_version.yml - - 4.0.0.yml - - 49-update-ansible-lint.yaml - - fixes.yml + - 4.0.0-increase_ansible_version.yml + - 4.0.0.yml + - 49-update-ansible-lint.yaml + - fixes.yml release_date: '2025-09-02' diff --git a/galaxy.yml b/galaxy.yml index 59628e6..b654b7f 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -14,8 +14,8 @@ tags: - infrastructure - cluster dependencies: - amazon.aws: '>=10.0.0' - community.aws: '>=10.0.0' + amazon.aws: '>=10.0.0,<12.0.0-dev0' + community.aws: '>=10.0.0,<12.0.0-dev0' repository: https://github.com/redhat-cop/cloud.aws_troubleshooting documentation: '' homepage: https://github.com/redhat-cop/cloud.aws_troubleshooting diff --git a/plugins/modules/eval_src_igw_route.py b/plugins/modules/eval_src_igw_route.py index a95351d..ff77e68 100644 --- a/plugins/modules/eval_src_igw_route.py +++ b/plugins/modules/eval_src_igw_route.py @@ -118,7 +118,7 @@ private_dns_name: "ip-192-168-0-11.ec2.internal" private_ip_address: "192.168.0.11" private_ip_addresses: - - association": + - association: ip_owner_id: "amazon" public_dns_name: "ec2-3-93-192-138.compute-1.amazonaws.com" public_ip: "3.93.192.138" diff --git a/plugins/modules/eval_vpc_peering.py b/plugins/modules/eval_vpc_peering.py index 3edb37f..71015bb 100644 --- a/plugins/modules/eval_vpc_peering.py +++ b/plugins/modules/eval_vpc_peering.py @@ -56,7 +56,7 @@ cidr_block: "172.25.0.0/28" cidr_block_set: - cidr_block: "172.25.0.0/28" - owner_id": "721066863947" + owner_id: "721066863947" peering_options: allow_dns_resolution_from_remote_vpc: false allow_egress_from_local_classic_link_to_remote_vpc: false diff --git a/plugins/modules/validate_route_tables.py b/plugins/modules/validate_route_tables.py index 197cb5c..ad494b9 100644 --- a/plugins/modules/validate_route_tables.py +++ b/plugins/modules/validate_route_tables.py @@ -80,8 +80,8 @@ owner_id: "00000000000" private_dns_name_options_on_launch: enable_resource_name_dns_a_record: false - enable_resource_name_dns_aaaa_record": false - hostname_type": "ip-name" + enable_resource_name_dns_aaaa_record: false + hostname_type: "ip-name" state: "available" subnet_arn: "arn:aws:ec2:eu-west-2:721066863947:subnet/subnet-032f1a2598b6318ed" subnet_id: "subnet-032f1a2598b6318ed" @@ -163,8 +163,8 @@ interface_id: null network_interface_id: null origin: "CreateRoute" - state": "active" - vpc_id": "vpc-0bee28efef41e1de4" + state: "active" + vpc_id: "vpc-0bee28efef41e1de4" src_subnets: - assign_ipv6_address_on_creation: false availability_zone: "eu-west-2a" @@ -181,7 +181,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" diff --git a/tox.ini b/tox.ini index 798bad7..fcdc7d4 100644 --- a/tox.ini +++ b/tox.ini @@ -6,22 +6,24 @@ skipsdist = True 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:ansible-lint] +description = Run ansible-lint deps = ansible-lint >= 25.1.2 -commands = ansible-lint --profile production --format pep8 --nocolor --strict . +commands = ansible-lint [testenv:black] +description = Lint against "black" formatting standards deps = - black + black >= 24.0, < 25.0 commands = black --check --diff {[common]format_dirs} [testenv:black_format] +description = Apply "black" formatting deps = {[testenv:black]deps} commands = @@ -34,12 +36,14 @@ 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 = @@ -58,14 +62,16 @@ deps = {[testenv:black]deps} {[testenv:flake8]deps} {[testenv:isort]deps} + {[testenv:ansible-lint]deps} commands = {[testenv:black]commands} {[testenv:flake8]commands} {[testenv:isort]commands} + {[testenv:ansible-lint]commands} [flake8] exclude = .git,.tox,tests/output -ignore = E501, W503, W504, E402, E501 +ignore = E501, W503, W504, E402 max-line-length = 160 builtins = _ show-source = True