Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ansible/ansible-lint since ansible/ansible-lint-action has been archived #84

Merged
merged 36 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
9657623
Use ansible/ansible-lint instead as ansible/ansible-lint-action has b…
alinabuzachis Aug 15, 2023
16d09ab
Bump ansible-lint version
alinabuzachis Aug 15, 2023
725b10c
Bump ansible-lint version to 6.18.0 as suggested
alinabuzachis Aug 23, 2023
86c6f4d
Bump Ansible-lint version to 6.18.0 as suggested
alinabuzachis Aug 23, 2023
90cf099
Black formatting
alinabuzachis Aug 24, 2023
704552d
Update build_ignore
alinabuzachis Aug 24, 2023
05009f0
Switch back to ansible-lint 6.16
alinabuzachis Aug 24, 2023
0173f66
Switch back to ansible-lint 6.18
alinabuzachis Aug 24, 2023
402bcfe
Add sanity requirements
alinabuzachis Aug 24, 2023
848d385
Update ansible-lint version
alinabuzachis Sep 8, 2023
f7e0c1e
Apply some ansible-lint changes
alinabuzachis Sep 12, 2023
2975f41
Add changelog fragment
alinabuzachis Sep 12, 2023
f77ff54
Yet another round of ansible-lint
alinabuzachis Sep 26, 2023
0cfff3c
Another rouond of fixes
alinabuzachis Oct 9, 2023
b420fce
Fix indentation
alinabuzachis Oct 9, 2023
b912174
Fix variable name
alinabuzachis Oct 19, 2023
1e95a43
Update upon review
alinabuzachis Oct 19, 2023
76b4b3a
Fix integration tests for manage_transit_gateway
alinabuzachis Oct 19, 2023
09f16a1
Fix test_backup_create_plan integration tests
alinabuzachis Oct 19, 2023
affb861
Fix customized_ami integration tests
alinabuzachis Oct 19, 2023
65accbd
Fix manage_transit_gateway integration tests
alinabuzachis Oct 20, 2023
241a2bb
Update main.yml
alinabuzachis Oct 20, 2023
60023dc
Fix linting
alinabuzachis Oct 20, 2023
89a0034
Fix test_backup_select_resources integration tests
alinabuzachis Oct 20, 2023
240013b
Update main.yml
alinabuzachis Oct 20, 2023
8ce48ef
Update main.yml
alinabuzachis Oct 20, 2023
8190306
Update main.yml
alinabuzachis Oct 20, 2023
a052a73
Update ansible-lint version
alinabuzachis Oct 31, 2023
502dbaa
Update fqdn
alinabuzachis Oct 31, 2023
ec289ab
Fix ansible-lint
alinabuzachis Oct 31, 2023
abc328c
Fix test_deploy_flask_app integration tests
alinabuzachis Nov 7, 2023
bb0b7af
Disable test_deploy_flask_app integration tests
alinabuzachis Nov 7, 2023
989d13a
Upadte meta/runtime.yml
alinabuzachis Nov 8, 2023
2e938dc
Fix test_aws_setup_credentials
alinabuzachis Nov 8, 2023
9807f90
Update sanity.yml
abikouo Nov 10, 2023
38f26d7
Remove support for ansible-core < 2.14
abikouo Nov 10, 2023
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
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
Loading