Skip to content

Commit

Permalink
Yet another round of lint fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Alina Buzachis <abuzachis@redhat.com>
  • Loading branch information
alinabuzachis committed Jul 5, 2023
1 parent a8026de commit ba47f5e
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion roles/aws_setup_credentials/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- name: Define intial value for credentials
ansible.builtin.set_fact:
aws_setup_credentials__aws_role_credentials: {}
aws_setup_credentials__output: {}
- name: Create auth credentials
ansible.builtin.include_tasks: read_option.yml
with_dict: "{{ aws_connection_env }}"
14 changes: 7 additions & 7 deletions roles/connectivity_troubleshooter_igw/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
block:
- name: Fail when next hop type is not supported by this role
ansible.legacy.fail:
msg: Next hop type '{{ next_hop }}' is not supported by this role
when: "'igw-' not in next_hop"
msg: Next hop type '{{ connectivity_troubleshooter_validate__next_hop }}' is not supported by this role
when: "'igw-' not in connectivity_troubleshooter_validate__next_hop"

- name: Gather information about Source security groups
amazon.aws.ec2_security_group_info:
filters:
group_id: "{{ item }}"
register: connectivity_troubleshooter_igw__src_security_groups
with_items: "{{ src_security_groups }}"
with_items: "{{ connectivity_troubleshooter_igw__src_security_groups }}"

- name: Gather information about Source subnet network ACLs
community.aws.ec2_vpc_nacl_info:
Expand All @@ -23,11 +23,11 @@

- name: Set 'src_subnet_nacls' variable
ansible.legacy.set_fact:
src_subnet_nacls: "{{ src_subnet_nacls | d([]) + [dict(_keys | zip(_vals))] }}"
connectivity_troubleshooter_igw__src_subnet_nacls: "{{ src_subnet_nacls | d([]) + [dict(connectivity_troubleshooter_igw__keys | zip(connectivity_troubleshooter_igw__vals))] }}"
loop: "{{ connectivity_troubleshooter_igw__src_subnet_nacls.nacls }}"
vars:
_keys: "{{ ['egress', 'ingress'] }}"
_vals: "{{ ['egress', 'ingress'] | map('extract', item) }}"
connectivity_troubleshooter_igw__keys: "{{ ['egress', 'ingress'] }}"
connectivity_troubleshooter_igw__vals: "{{ ['egress', 'ingress'] | map('extract', item) }}"

- name: Set 'connectivity_troubleshooter_igw__src_security_groups_info' variable
ansible.legacy.set_fact:
Expand All @@ -42,5 +42,5 @@
dst_port: "{{ connectivity_troubleshooter_igw_destination_port }}"
src_network_interface: "{{ src_network_interface }}"
src_security_groups_info: "{{ connectivity_troubleshooter_igw__src_security_groups_info }}"
src_network_acls: "{{ src_subnet_nacls }}"
src_network_acls: "{{connectivity_troubleshooter_igw__src_subnet_nacls }}"
register: connectivity_troubleshooter_igw__result_eval_src_igw_route
16 changes: 8 additions & 8 deletions roles/connectivity_troubleshooter_local/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@

- name: Set 'connectivity_troubleshooter_local__dst_vpc_id', 'connectivity_troubleshooter_local__dst_subnet_id' and 'connectivity_troubleshooter_local__dst_security_groups' variables
ansible.builtin.set_fact:
connectivity_troubleshooter_local__dst_vpc_id: "{{ __dst_network_interface_info.vpc_id }}"
connectivity_troubleshooter_local__dst_subnet_id: "{{ __dst_network_interface_info.subnet_id }}"
connectivity_troubleshooter_local__dst_security_groups: "{{ __dst_network_interface_info.groups | map(attribute='group_id') | list }}"
connectivity_troubleshooter_local__dst_vpc_id: "{{ connectivity_troubleshooter_local__dst_network_interface_info.vpc_id }}"
connectivity_troubleshooter_local__dst_subnet_id: "{{ connectivity_troubleshooter_local__dst_network_interface_info.subnet_id }}"
connectivity_troubleshooter_local__dst_security_groups: "{{ connectivity_troubleshooter_local__dst_network_interface_info.groups | map(attribute='group_id') | list }}"
vars:
__dst_network_interface_info: "{{ connectivity_troubleshooter_local__describe_dst_eni.network_interfaces.0 }}"
connectivity_troubleshooter_local__dst_network_interface_info: "{{ connectivity_troubleshooter_local__describe_dst_eni.network_interfaces.0 }}"

- name: Fail when no network interface found
ansible.builtin.fail:
Expand Down Expand Up @@ -90,13 +90,13 @@
- "{{ dst_subnet_id }}"
register: connectivity_troubleshooter_local__network_acls_info

- name: Set 'dst_network_acls_info' variable
- name: Set 'connectivity_troubleshooter_local__dst_network_acls_info' variable
ansible.builtin.set_fact:
connectivity_troubleshooter_local__dst_network_acls_info: "{{ connectivity_troubleshooter_local__dst_network_acls_info | d([]) + [dict(_keys | zip(_vals))] }}"
connectivity_troubleshooter_local__dst_network_acls_info: "{{ connectivity_troubleshooter_local__dst_network_acls_info | d([]) + [dict(connectivity_troubleshooter_local__keys | zip(connectivity_troubleshooter_local__vals))] }}"
loop: "{{ connectivity_troubleshooter_local__network_acls_info.nacls }}"
vars:
_keys: "{{ ['egress', 'ingress'] }}"
_vals: "{{ ['egress', 'ingress'] | map('extract', item) }}"
connectivity_troubleshooter_local__keys: "{{ ['egress', 'ingress'] }}"
connectivity_troubleshooter_local__vals: "{{ ['egress', 'ingress'] | map('extract', item) }}"

- name: Evaluate ingress and egress netwok ACLs
cloud.aws_troubleshooting.eval_network_acls:
Expand Down
12 changes: 6 additions & 6 deletions roles/connectivity_troubleshooter_nat/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

- name: Set 'connectivity_troubleshooter_nat__nat_subnet_id' and 'connectivity_troubleshooter_nat__nat_vpc_id' variables
ansible.builtin.set_fact:
connectivity_troubleshooter_nat__nat_subnet_id: "{{ __nat_gw_info.subnet_id }}"
connectivity_troubleshooter_nat__nat_vpc_id: "{{ __nat_gw_info.vpc_id }}"
connectivity_troubleshooter_nat__nat_subnet_id: "{{ connectivity_troubleshooter_nat__nat_gw_info.subnet_id }}"
connectivity_troubleshooter_nat__nat_vpc_id: "{{ connectivity_troubleshooter_nat__nat_gw_info.vpc_id }}"
vars:
__nat_gw_info: "{{ connectivity_troubleshooter_nat__describe_nat_gw.result.0 }}"
connectivity_troubleshooter_nat__nat_gw_info: "{{ connectivity_troubleshooter_nat__describe_nat_gw.result.0 }}"

- name: Gather information about NAT gateway subnet networks ACLs
community.aws.ec2_vpc_nacl_info:
Expand All @@ -29,11 +29,11 @@

- name: Set 'connectivity_troubleshooter__nat_network_acls' variable
ansible.builtin.set_fact:
connectivity_troubleshooter_nat__nat_network_acls: "{{ connectivity_troubleshooter_nat__nat_network_acls | d([]) + [dict(_keys | zip(_vals))] }}"
connectivity_troubleshooter_nat__nat_network_acls: "{{ connectivity_troubleshooter_nat__nat_network_acls | d([]) + [dict(connectivity_troubleshooter_nat__keys | zip(connectivity_troubleshooter_nat__vals))] }}"
loop: "{{ connectivity_troubleshooter_nat__nat_network_acls_info.nacls }}"
vars:
_keys: "{{ ['egress', 'ingress'] }}"
_vals: "{{ ['egress', 'ingress'] | map('extract', item) }}"
connectivity_troubleshooter_nat__keys: "{{ ['egress', 'ingress'] }}"
connectivity_troubleshooter_nat__vals: "{{ ['egress', 'ingress'] | map('extract', item) }}"

- name: Gather information about VPC route table
amazon.aws.ec2_vpc_route_table_info:
Expand Down
6 changes: 3 additions & 3 deletions roles/connectivity_troubleshooter_peering/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
connectivity_troubleshooter_peering__dst_peer_vpc_id: "{{ connectivity_troubleshooter_peering__dst_peer_eni_info.vpc_id }}"
connectivity_troubleshooter_peering__dst_peer_subnet_id: "{{ connectivity_troubleshooter_peering__dst_peer_eni_info.subnet_id }}"
vars:
__dst_peer_eni_info: "{{ connectivity_troubleshooter_peering__dst_peer_eni.network_interfaces.0 }}"
connectivity_troubleshooter_peering__dst_peer_eni_info: "{{ connectivity_troubleshooter_peering__dst_peer_eni.network_interfaces.0 }}"

- name: Gather information about Destination peer subnet
amazon.aws.ec2_vpc_route_table_info:
Expand All @@ -37,7 +37,7 @@

- name: Set 'routes' variable
ansible.builtin.set_fact:
routes: "{{ connectivity_troubleshooter_peering__dst_peer_route_table.route_tables.0.routes }}"
connectivity_troubleshooter_validate__routes: "{{ connectivity_troubleshooter_peering__dst_peer_route_table.route_tables.0.routes }}"
when: connectivity_troubleshooter_peering__dst_peer_route_table.route_tables | length > 0

# if RouteTable is not returned, this indicates association of subnet with main route table
Expand All @@ -63,7 +63,7 @@
- name: Evaluate VPC peering connection
cloud.aws_troubleshooting.eval_vpc_peering:
src_ip: "{{ connectivity_troubleshooter_peering_source_ip }}"
peering_id: "{{ next_hop }}"
peering_id: "{{ connectivity_troubleshooter_validate__next_hop }}"
dst_vpc: "{{ connectivity_troubleshooter_peering_destination_vpc }}"
routes: "{{ connectivity_troubleshooter_peering__routes }}"
vpc_peering_connection: "{{ connectivity_troubleshooter_peering__vpc_peering_connection_info.vpc_peering_connections.0 }}"
4 changes: 2 additions & 2 deletions roles/connectivity_troubleshooter_validate/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
connectivity_troubleshooter_validate__src_security_groups: "{{ connectivity_troubleshooter_validate__src_network_interface_info.groups | map(attribute='group_id') | list }}"
connectivity_troubleshooter_validate__src_network_interface: "{{ connectivity_troubleshooter_validate__src_network_interface_info }}"
vars:
__src_network_interface_info: "{{ connectivity_troubleshooter_validate__describe_src_eni.network_interfaces.0 }}"
connectivity_troubleshooter_validate__src_network_interface_info: "{{ connectivity_troubleshooter_validate__describe_src_eni.network_interfaces.0 }}"

- name: Gather information about Source VPC route table
amazon.aws.ec2_vpc_route_table_info:
Expand Down Expand Up @@ -78,7 +78,7 @@
msg: Could not find route table for connectivity_troubleshooter_validate_source_ip
when: connectivity_troubleshooter_validate__src_route_table_retry.route_tables | length == 0

- name: Set 'routes' variable
- name: Set 'connectivity_troubleshooter_validate__routes' variable
ansible.builtin.set_fact:
connectivity_troubleshooter_validate__routes: "{{ connectivity_troubleshooter_validate__src_route_table_retry.route_tables.0.routes }}"

Expand Down

0 comments on commit ba47f5e

Please sign in to comment.