Skip to content

Commit

Permalink
Merge pull request #84 from alinabuzachis/update_linter_action
Browse files Browse the repository at this point in the history
Use ansible/ansible-lint since ansible/ansible-lint-action has been archived
  • Loading branch information
abikouo authored Nov 15, 2023
2 parents f24c6f3 + 38f26d7 commit 9cd7c96
Show file tree
Hide file tree
Showing 61 changed files with 662 additions and 657 deletions.
3 changes: 3 additions & 0 deletions .config/ansible-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ skip_list:
- meta-no-info # meta/main.yml should contain relevant info.
- latest[git] # Result of the command may vary on subsequent runs.
- no-handler # Tasks that run when changed should likely be handlers.
- no-changed-when # Commands should not change things if nothing needs doing.
exclude_paths:
- tests/integration
4 changes: 2 additions & 2 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

'on':
on:
push:
pull_request:

Expand All @@ -17,4 +17,4 @@ jobs:
- uses: ansible-network/github_actions/.github/actions/checkout_dependency@main

- name: Run ansible-lint
uses: ansible/ansible-lint-action@v6.16.0
uses: ansible/ansible-lint@v6.21.0
73 changes: 0 additions & 73 deletions .github/workflows/sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,76 +14,3 @@ on:
jobs:
sanity:
uses: ansible-network/github_actions/.github/workflows/sanity.yml@main
with:
matrix_include: "[]"
matrix_exclude: >-
[
{
"ansible-version": "stable-2.9"
},
{
"ansible-version": "stable-2.12",
"python-version": "3.7"
},
{
"ansible-version": "stable-2.12",
"python-version": "3.11"
},
{
"ansible-version": "stable-2.13",
"python-version": "3.7"
},
{
"ansible-version": "stable-2.13",
"python-version": "3.11"
},
{
"ansible-version": "stable-2.14",
"python-version": "3.7"
},
{
"ansible-version": "stable-2.14",
"python-version": "3.8"
},
{
"ansible-version": "stable-2.15",
"python-version": "3.7"
},
{
"ansible-version": "stable-2.15",
"python-version": "3.8"
},
{
"ansible-version": "milestone",
"python-version": "3.7"
},
{
"ansible-version": "milestone",
"python-version": "3.8"
},
{
"ansible-version": "milestone",
"python-version": "3.9"
},
{
"ansible-version": "devel",
"python-version": "3.7"
},
{
"ansible-version": "devel",
"python-version": "3.8"
},
{
"ansible-version": "devel",
"python-version": "3.9"
}
]
all_green:
if: ${{ always() }}
needs:
- sanity
runs-on: ubuntu-latest
steps:
- run: >-
python -c "assert '${{ needs.sanity.result }}'
in ['success', 'failure']"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The collection includes a variety of Ansible roles, playbooks, and rulebooks to
<!--start requires_ansible-->
## Ansible version compatibility

This collection has been tested against following Ansible versions: **>=2.13.0**.
This collection has been tested against following Ansible versions: **>=2.14.0**.

## Included content

Expand Down
32 changes: 32 additions & 0 deletions changelogs/fragments/ansible_lint_6_19.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
breaking_changes:
- Remove support for ansible-core < 2.14
- roles/awsconfig_multiregion_cloudtrail - ``operation`` option has been renamed to ``awsconfig_multiregion_cloudtrail_operation`` (https://github.com/redhat-cop/cloud.aws_ops/pull/84).
- roles/awsconfig_multiregion_cloudtrail - ``bucket_name`` option has been renamed to ``awsconfig_multiregion_cloudtrail_bucket_name`` (https://github.com/redhat-cop/cloud.aws_ops/pull/84).
- roles/awsconfig_multiregion_cloudtrail - ``key_prefix`` option has been renamed to ``awsconfig_multiregion_cloudtrail_key_prefix`` (https://github.com/redhat-cop/cloud.aws_ops/pull/84).
- roles/awsconfig_multiregion_cloudtrail - ``trail_name`` option has been renamed to ``awsconfig_multiregion_cloudtrail_trail_name`` (https://github.com/redhat-cop/cloud.aws_ops/pull/84).
- roles/backup_create_plan - ``plan_name`` option has been renamed to ``backup_create_plan_plan_name`` (https://github.com/redhat-cop/cloud.aws_ops/pull/84).
- roles/backup_create_plan - ``plan_rules`` option has been renamed to ``backup_create_plan_plan_rules`` (https://github.com/redhat-cop/cloud.aws_ops/pull/84).
- roles/backup_create_plan - ``plan_windows_vss_settings`` option has been renamed to ``backup_create_plan_plan_windows_vss_settings`` (https://github.com/redhat-cop/cloud.aws_ops/pull/84).
- roles/backup_create_plan - ``plan_tags`` option has been renamed to ``backup_create_plan_plan_tags`` (https://github.com/redhat-cop/cloud.aws_ops/pull/84).
- roles/backup_create_plan - ``vault_name`` option has been renamed to ``backup_create_plan_vault_name`` (https://github.com/redhat-cop/cloud.aws_ops/pull/84).
- roles/backup_create_plan - ``vault_encryption_key_arn`` option has been renamed to ``backup_create_plan_vault_encryption_key_arn`` (https://github.com/redhat-cop/cloud.aws_ops/pull/84).
- roles/backup_create_plan - ``vault_tags`` option has been renamed to ``backup_create_planvault_tags`` (https://github.com/redhat-cop/cloud.aws_ops/pull/84).
- roles/backup_select_resources - ``plan_name`` option has been renamed to ``backup_select_resources_plan_name`` (https://github.com/redhat-cop/cloud.aws_ops/pull/84).
- roles/backup_select_resources - ``selection_name`` option has been renamed to ``backup_select_resources_selection_name`` (https://github.com/redhat-cop/cloud.aws_ops/pull/84).
- roles/backup_select_resources - ``selection_tags`` option has been renamed to ``backup_select_resources_selection_tags`` (https://github.com/redhat-cop/cloud.aws_ops/pull/84).
- roles/backup_select_resources - ``selection_conditions`` option has been renamed to ``backup_select_resources_selection_conditions`` (https://github.com/redhat-cop/cloud.aws_ops/pull/84).
- roles/backup_select_resources - ``backup_role_name`` option has been renamed to ``backup_select_resources_backup_role_name`` (https://github.com/redhat-cop/cloud.aws_ops/pull/84).
- roles/customized_ami - ``custom_ami_operation`` option has been renamed to ``customized_ami_operation`` (https://github.com/redhat-cop/cloud.aws_ops/pull/84).
- roles/customized_ami - ``custom_ami_name`` option has been renamed to ``customized_ami_name`` (https://github.com/redhat-cop/cloud.aws_ops/pull/84).
- roles/customized_ami - ``custom_ami_packages`` option has been renamed to ``customized_ami_packages`` (https://github.com/redhat-cop/cloud.aws_ops/pull/84).
- roles/customized_ami - ``custom_ami_recreate_if_exists`` option has been renamed to ``customized_ami_recreate_if_exists`` (https://github.com/redhat-cop/cloud.aws_ops/pull/84).
- roles/customized_ami - ``source_ami_filters`` option has been renamed to ``customized_ami_source_ami_filters`` (https://github.com/redhat-cop/cloud.aws_ops/pull/84).
- roles/customized_ami - ``source_ami_image_id`` option has been renamed to ``customized_ami_source_ami_image_id`` (https://github.com/redhat-cop/cloud.aws_ops/pull/84).
- roles/customized_ami - ``source_ami_user_name`` option has been renamed to ``customized_ami_source_ami_user_name`` (https://github.com/redhat-cop/cloud.aws_ops/pull/84).
- roles/ec2_instance_terminate_by_tag - ``tag_key_to_terminate_instances`` option has been renamed to `` ec2_instance_terminate_by_tag_tag_key_to_terminate_instances`` (https://github.com/redhat-cop/cloud.aws_ops/pull/84).
- roles/ec2_instance_terminate_by_tag - ``tag_value_to_terminate_instances`` option has been renamed to `` ec2_instance_terminate_by_tag_tag_value_to_terminate_instances`` (https://github.com/redhat-cop/cloud.aws_ops/pull/84).
- roles/ec2_instance_terminate_by_tag - ``terminate_protected_instances`` option has been renamed to `` ec2_instance_terminate_by_tag_terminate_protected_instances`` (https://github.com/redhat-cop/cloud.aws_ops/pull/84).
- roles/manage_transit_gateway - ``action`` option has been renamed to `` manage_transit_gateway_action`` (https://github.com/redhat-cop/cloud.aws_ops/pull/84).
- roles/manage_transit_gateway - ``transit_gateway`` option has been renamed to `` manage_transit_gateway_transit_gateway`` (https://github.com/redhat-cop/cloud.aws_ops/pull/84).
- roles/manage_transit_gateway - ``vpc_attachment`` option has been renamed to `` manage_transit_gateway_vpc_attachment`` (https://github.com/redhat-cop/cloud.aws_ops/pull/84).
- roles/manage_transit_gateway - ``vpn_attachment`` option has been renamed to `` manage_transit_gateway_vpn_attachment`` (https://github.com/redhat-cop/cloud.aws_ops/pull/84).
2 changes: 2 additions & 0 deletions changelogs/fragments/update_ansible_lint_action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
trivial:
- "Use ansible/ansible-lint since ansible/ansible-lint-action has been archived."
2 changes: 2 additions & 0 deletions galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ version: 1.0.3
build_ignore:
- .DS_Store
- '*.tar.gz'
- '*cloud-config-aws.ini'
- '*cloud-config-aws.yml'
2 changes: 1 addition & 1 deletion meta/runtime.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
requires_ansible: '>=2.12.0'
requires_ansible: '>=2.14.0'
8 changes: 4 additions & 4 deletions playbooks/aws_restore_cloudtrail.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
ansible.builtin.include_role:
name: cloud.aws_ops.awsconfig_multiregion_cloudtrail
vars:
operation: create
bucket_name: "{{ s3_bucket_name }}"
key_prefix: "{{ s3_key_prefix | default(omit) }}"
trail_name: "{{ cloudtrail_name }}"
awsconfig_multiregion_cloudtrail_operation: create
awsconfig_multiregion_cloudtrail_bucket_name: "{{ s3_bucket_name }}"
awsconfig_multiregion_cloudtrail_key_prefix: "{{ s3_key_prefix | default(omit) }}"
awsconfig_multiregion_cloudtrail_trail_name: "{{ cloudtrail_name }}"

- name: Include 'cloud.aws_ops.enable_cloudtrail_encryption_with_kms' role
ansible.builtin.include_role:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,23 @@
ansible.builtin.import_role:
name: cloud.aws_ops.clone_on_prem_vm
vars:
clone_on_prem_vm_source_vm_name: "{{ clone_on_prem_vm_source_vm_name }}"
clone_on_prem_vm_image_name: "{{ clone_on_prem_vm_image_name }}"
clone_on_prem_vm_uri: "{{ clone_on_prem_vm_uri }}"
clone_on_prem_vm_local_image_path: "{{ clone_on_prem_vm_local_image_path }}"
clone_on_prem_vm_overwrite: "{{ clone_on_prem_vm_overwrite }}"
clone_on_prem_vm_source_vm_name: "{{ source_vm_name }}"
clone_on_prem_vm_image_name: "{{ image_name }}"
clone_on_prem_vm_uri: "{{ uri }}"
clone_on_prem_vm_local_image_path: "{{ local_image_path }}"
clone_on_prem_vm_overwrite: "{{ overwrite }}"
delegate_to: kvm

- name: Import 'cloud.aws_ops.import_image_and_run_aws_instance' role
ansible.builtin.import_role:
name: cloud.aws_ops.import_image_and_run_aws_instance
vars:
import_image_and_run_aws_instance_bucket_name: "{{ import_image_and_run_aws_instance_bucket_name }}"
import_image_and_run_aws_instance_image_path: "{{ clone_on_prem_vm_raw_image_path }}"
import_image_and_run_aws_instance_instance_name: "{{ import_image_and_run_aws_instance_instance_name }}"
import_image_and_run_aws_instance_instance_type: "{{ import_image_and_run_aws_instance_instance_type }}"
import_image_and_run_aws_instance_import_image_task_name: "{{ import_image_and_run_aws_instance_import_image_task_name }}"
import_image_and_run_aws_instances_keypair_name: "{{ import_image_and_run_aws_instances_keypair_name }}"
import_image_and_run_aws_instance_security_groups: "{{ import_image_and_run_aws_instance_security_groups }}"
import_image_and_run_aws_instance_vpc_subnet_id: "{{ import_image_and_run_aws_instance_vpc_subnet_id }}"
import_image_and_run_aws_instance_volumes: "{{ import_image_and_run_aws_instance_volumes }}"
import_image_and_run_aws_instance_bucket_name: "{{ bucket_name }}"
import_image_and_run_aws_instance_image_path: "{{ raw_image_path }}"
import_image_and_run_aws_instance_instance_name: "{{ instance_name }}"
import_image_and_run_aws_instance_instance_type: "{{ instance_type }}"
import_image_and_run_aws_instance_import_image_task_name: "{{ import_image_task_name }}"
import_image_and_run_aws_instance_keypair_name: "{{ keypair_name }}"
import_image_and_run_aws_instance_security_groups: "{{ security_groups }}"
import_image_and_run_aws_instance_vpc_subnet_id: "{{ vpc_subnet_id }}"
import_image_and_run_aws_instance_volumes: "{{ volumes }}"
2 changes: 1 addition & 1 deletion playbooks/webapp/webapp_ha_aurora.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- name: webapp HA
- name: Webapp HA
hosts: localhost
gather_facts: false
vars_files:
Expand Down
55 changes: 26 additions & 29 deletions plugins/modules/validate_network_acls.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,37 +56,36 @@
- name: Evaluate network ACLS from EC2 instance to RDS Instance
cloud.aws_ops.validate_network_acls:
dest_subnet_cidrs:
- 10.1.0.0/24
- 10.1.2.0/24
- 10.1.0.0/24
- 10.1.2.0/24
dest_network_acl_rules:
- egress:
- [100, "all", "allow", "0.0.0.0/0", null, null, 0, 65535]
ingress:
- [100, "all", "allow", "0.0.0.0/0", null, null, 0, 65535]
is_default: true
nacl_id: "acl-01124846ef9f50ff2"
owner_id: "000000000000"
subnets:
- "subnet-0af56e0d353f88cb8"
- "subnet-032f1a2598b6318ed"
vpc_id: "vpc-0274c44deffd7368a"
- egress:
- [100, "all", "allow", "0.0.0.0/0", null, null, 0, 65535]
ingress:
- [100, "all", "allow", "0.0.0.0/0", null, null, 0, 65535]
is_default: true
nacl_id: "acl-01124846ef9f50ff2"
owner_id: "000000000000"
subnets:
- "subnet-0af56e0d353f88cb8"
- "subnet-032f1a2598b6318ed"
vpc_id: "vpc-0274c44deffd7368a"
dest_port:
- 5432
- 5432
src_network_acl_rules:
- egress:
- [100, "all", "allow", "0.0.0.0/0", null, null, 0, 65535]
ingress:
- [100, "all", "allow", "0.0.0.0/0", null, null, 0, 65535]
is_default: true
nacl_id: "acl-01124846ef9f50ff2"
owner_id: "000000000000"
subnets:
- subnet-0af56e0d353f88cb8
- subnet-032f1a2598b6318ed
vpc_id: "vpc-0274c44deffd7368a"
- egress:
- [100, "all", "allow", "0.0.0.0/0", null, null, 0, 65535]
ingress:
- [100, "all", "allow", "0.0.0.0/0", null, null, 0, 65535]
is_default: true
nacl_id: "acl-01124846ef9f50ff2"
owner_id: "000000000000"
subnets:
- subnet-0af56e0d353f88cb8
- subnet-032f1a2598b6318ed
vpc_id: "vpc-0274c44deffd7368a"
src_private_ip:
- 172.10.3.10
- 172.10.3.10
"""

RETURN = r"""
Expand Down Expand Up @@ -136,7 +135,6 @@ def is_port_in_range(port, from_port, to_port):

class ValidateNetworkACL(AnsibleModule):
def __init__(self):

argument_spec = dict(
dest_subnet_cidrs=dict(type="list", elements="str", required=True),
dest_network_acl_rules=dict(type="list", elements="dict", required=True),
Expand Down Expand Up @@ -221,7 +219,6 @@ def execute_module(self):


def main():

ValidateNetworkACL()


Expand Down
Loading

0 comments on commit 9cd7c96

Please sign in to comment.