Skip to content
This repository was archived by the owner on Feb 24, 2026. It is now read-only.

Commit eca2d55

Browse files
committed
style: update files to conform with new lint behavior
Signed-off-by: Gerard Vanloo <gerard.vanloo@ibm.com>
1 parent 557cfdd commit eca2d55

11 files changed

Lines changed: 118 additions & 118 deletions

File tree

sre/dev/remote_cluster/roles/awx/tasks/create_async.yaml

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@
55
cidr_block: "{{ awx_stack.runners.aws.vpc.cidr }}"
66
region: "{{ awx_cluster.aws.region }}"
77
state: present
8-
register: vpc_info
8+
register: awx_vpc_info
99

1010
- name: Create an Internet Gateway associated with VPC
1111
amazon.aws.ec2_vpc_igw:
12-
vpc_id: "{{ vpc_info.vpc.id }}"
12+
vpc_id: "{{ awx_vpc_info.vpc.id }}"
1313
region: "{{ awx_cluster.aws.region }}"
1414
state: present
15-
register: igw_info
15+
register: awx_igw_info
1616

1717
- name: Create a subnet for each cluster
1818
amazon.aws.ec2_vpc_subnet:
19-
vpc_id: "{{ vpc_info.vpc.id }}"
19+
vpc_id: "{{ awx_vpc_info.vpc.id }}"
2020
cidr: "{{ awx_stack.runners.aws.subnet.public_base }}.{{ item * 2 }}.0/23"
2121
az: "{{ awx_cluster.aws.zones[0] }}"
2222
region: "{{ awx_cluster.aws.region }}"
@@ -26,21 +26,21 @@
2626
Name: "{{ awx_stack.name_prefix }}-public-subnet-{{ item }}"
2727
Environment: k8s
2828
ManagedBy: ansible
29-
loop: "{{ range(1, (cluster_names | length) + 1) }}"
30-
register: public_subnets
29+
loop: "{{ range(1, (awx_cluster_names | length) + 1) }}"
30+
register: awx_public_subnets
3131

3232
- name: Parse subnet ids
3333
ansible.builtin.set_fact:
34-
subnet_ids: "{{ public_subnets.results | community.general.json_query('[*].subnet.id') }}"
34+
subnet_ids: "{{ awx_public_subnets.results | community.general.json_query('[*].subnet.id') }}"
3535

3636
- name: Create a route table for public subnets
3737
amazon.aws.ec2_vpc_route_table:
38-
vpc_id: "{{ vpc_info.vpc.id }}"
38+
vpc_id: "{{ awx_vpc_info.vpc.id }}"
3939
region: "{{ awx_cluster.aws.region }}"
4040
subnets: "{{ subnet_ids }}"
4141
routes:
4242
- dest: "0.0.0.0/0"
43-
gateway_id: "{{ igw_info.gateway_id }}"
43+
gateway_id: "{{ awx_igw_info.gateway_id }}"
4444
tags:
4545
Name: "{{ awx_stack.name_prefix }}-public-route-table"
4646
Creator: "ansible"
@@ -58,7 +58,7 @@
5858
- --topology
5959
- public
6060
- --network-id
61-
- "{{ vpc_info.vpc.id }}"
61+
- "{{ awx_vpc_info.vpc.id }}"
6262
- --subnets
6363
- "{{ item[1] }}"
6464
- --zones
@@ -76,16 +76,16 @@
7676
- --networking
7777
- "{{ awx_cluster.networking.mode }}"
7878
- --state
79-
- "{{ state_store }}"
79+
- "{{ awx_kops_state_store }}"
8080
async: 600
81-
loop: "{{ cluster_names | zip(subnet_ids) }}"
81+
loop: "{{ awx_cluster_names | zip(subnet_ids) }}"
8282
poll: 0
83-
register: async_create_results
83+
register: awx_async_create_results
8484

8585
- name: Wait for asynchronous operations to complete
8686
ansible.builtin.async_status:
8787
jid: "{{ item.ansible_job_id }}"
88-
loop: "{{ async_create_results.results }}"
88+
loop: "{{ awx_async_create_results.results }}"
8989
register: async_create_poll_results
9090
until: async_create_poll_results.finished
9191
delay: 30
@@ -95,7 +95,7 @@
9595
ansible.builtin.async_status:
9696
mode: cleanup
9797
jid: "{{ item.ansible_job_id }}"
98-
loop: "{{ async_create_results.results }}"
98+
loop: "{{ awx_async_create_results.results }}"
9999

100100
- name: Asynchronously build kOps clusters
101101
ansible.builtin.command:
@@ -106,19 +106,19 @@
106106
- --name
107107
- "{{ item }}"
108108
- --state
109-
- "{{ state_store }}"
109+
- "{{ awx_kops_state_store }}"
110110
- --yes
111111
- --internal
112112
- --create-kube-config=false
113113
async: 600
114-
loop: "{{ cluster_names }}"
114+
loop: "{{ awx_cluster_names }}"
115115
poll: 0
116-
register: async_update_results
116+
register: awx_async_update_results
117117

118118
- name: Wait for asynchronous operations to complete
119119
ansible.builtin.async_status:
120120
jid: "{{ item.ansible_job_id }}"
121-
loop: "{{ async_update_results.results }}"
121+
loop: "{{ awx_async_update_results.results }}"
122122
register: async_update_poll_results
123123
until: async_update_poll_results.finished
124124
delay: 30
@@ -128,7 +128,7 @@
128128
ansible.builtin.async_status:
129129
mode: cleanup
130130
jid: "{{ item.ansible_job_id }}"
131-
loop: "{{ async_update_results.results }}"
131+
loop: "{{ awx_async_update_results.results }}"
132132

133133
- name: Export the kubeconfigs for the clusters
134134
ansible.builtin.command:
@@ -140,12 +140,12 @@
140140
- kubecfg
141141
- --admin
142142
- --state
143-
- "{{ state_store }}"
143+
- "{{ awx_kops_state_store }}"
144144
- --kubeconfig
145145
- /tmp/{{ item }}.yaml
146-
loop: "{{ cluster_names }}"
147-
register: export_kops_output
148-
changed_when: export_kops_output.rc == 0
146+
loop: "{{ awx_cluster_names }}"
147+
register: awx_kops_export_output
148+
changed_when: awx_kops_export_output.rc == 0
149149

150150
- name: Asynchronously validate kOps cluster
151151
ansible.builtin.command:
@@ -154,20 +154,20 @@
154154
- validate
155155
- cluster
156156
- --state
157-
- "{{ state_store }}"
157+
- "{{ awx_kops_state_store }}"
158158
- --wait
159159
- 10m
160160
environment:
161161
KUBECONFIG: /tmp/{{ item }}.yaml
162162
async: 600
163-
loop: "{{ cluster_names }}"
163+
loop: "{{ awx_cluster_names }}"
164164
poll: 0
165-
register: async_validate_results
165+
register: awx_async_validate_results
166166

167167
- name: Wait for asynchronous operations to complete
168168
ansible.builtin.async_status:
169169
jid: "{{ item.ansible_job_id }}"
170-
loop: "{{ async_validate_results.results }}"
170+
loop: "{{ awx_async_validate_results.results }}"
171171
register: async_validate_poll_results
172172
until: async_validate_poll_results.finished
173173
delay: 60
@@ -177,4 +177,4 @@
177177
ansible.builtin.async_status:
178178
mode: cleanup
179179
jid: "{{ item.ansible_job_id }}"
180-
loop: "{{ async_validate_results.results }}"
180+
loop: "{{ awx_async_validate_results.results }}"

sre/dev/remote_cluster/roles/awx/tasks/delete_async.yaml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99
- "{{ item }}"
1010
- --yes
1111
- --state
12-
- "{{ state_store }}"
12+
- "{{ awx_kops_state_store }}"
1313
async: 900
14-
loop: "{{ cluster_names }}"
14+
loop: "{{ awx_cluster_names }}"
1515
poll: 0
16-
register: async_delete_results
16+
register: awx_async_delete_results
1717

1818
- name: Wait for asynchronous operations to complete
1919
ansible.builtin.async_status:
2020
jid: "{{ item.ansible_job_id }}"
21-
loop: "{{ async_delete_results.results }}"
21+
loop: "{{ awx_async_delete_results.results }}"
2222
register: async_delete_poll_results
2323
until: async_delete_poll_results.finished
2424
delay: 30
@@ -28,30 +28,30 @@
2828
ansible.builtin.async_status:
2929
mode: cleanup
3030
jid: "{{ item.ansible_job_id }}"
31-
loop: "{{ async_delete_results.results }}"
31+
loop: "{{ awx_async_delete_results.results }}"
3232

3333
- name: Find all route tables associated with kOps clusters
3434
amazon.aws.ec2_vpc_route_table_info:
3535
filters:
3636
"tag:Name": "{{ awx_stack.name_prefix }}-public-route-table"
3737
region: "{{ awx_cluster.aws.region }}"
38-
register: route_tables_info
38+
register: awx_route_tables_info
3939

4040
- name: Find all subnets associated with route tables' VPCs
4141
amazon.aws.ec2_vpc_subnet_info:
4242
filters:
4343
vpc-id: "{{ item.vpc_id }}"
4444
region: "{{ awx_cluster.aws.region }}"
45-
loop: "{{ route_tables_info.route_tables }}"
46-
register: subnet_info_list
45+
loop: "{{ awx_route_tables_info.route_tables }}"
46+
register: awx_subnet_info_list
4747

4848
- name: Delete all associated subnets
4949
amazon.aws.ec2_vpc_subnet:
5050
state: absent
5151
vpc_id: "{{ item.vpc_id }}"
5252
region: "{{ awx_cluster.aws.region }}"
5353
cidr: "{{ item.cidr_block }}"
54-
loop: "{{ subnet_info_list.results | sum(attribute='subnets', start=[]) }}"
54+
loop: "{{ awx_subnet_info_list.results | sum(attribute='subnets', start=[]) }}"
5555

5656
- name: Delete all associated route tables
5757
amazon.aws.ec2_vpc_route_table:
@@ -60,18 +60,18 @@
6060
route_table_id: "{{ item.id }}"
6161
lookup: id
6262
state: absent
63-
loop: "{{ route_tables_info.route_tables }}"
63+
loop: "{{ awx_route_tables_info.route_tables }}"
6464

6565
- name: Delete all associated Internet Gateway
6666
amazon.aws.ec2_vpc_igw:
6767
state: absent
6868
vpc_id: "{{ item }}"
6969
region: "{{ awx_cluster.aws.region }}"
70-
loop: "{{ route_tables_info.route_tables | community.general.json_query('[*].vpc_id') }}"
70+
loop: "{{ awx_route_tables_info.route_tables | community.general.json_query('[*].vpc_id') }}"
7171

7272
- name: Delete all associated VPCs
7373
amazon.aws.ec2_vpc_net:
7474
state: absent
7575
vpc_id: "{{ item }}"
7676
region: "{{ awx_cluster.aws.region }}"
77-
loop: "{{ route_tables_info.route_tables | community.general.json_query('[*].vpc_id') }}"
77+
loop: "{{ awx_route_tables_info.route_tables | community.general.json_query('[*].vpc_id') }}"
Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
---
22
- name: Set variables
33
ansible.builtin.set_fact:
4-
head_cluster_name: "{{ awx_stack.name_prefix }}-head-aws.k8s.local"
5-
runner_cluster_names: |
4+
awx_head_cluster_name: "{{ awx_stack.name_prefix }}-head-aws.k8s.local"
5+
awx_runner_cluster_names: |
66
{{
77
[awx_stack.name_prefix + "-runner"] |
88
product(range(1, awx_stack.runners.count + 1) | map('string')) |
99
map('join', '-') |
1010
zip_longest([], fillvalue="aws.k8s.local") |
1111
map('join', '-')
1212
}}
13-
state_store: s3://{{ awx_cluster.s3.bucket_name }}
13+
awx_kops_state_store: s3://{{ awx_cluster.s3.bucket_name }}
1414
tags:
1515
- always
1616

@@ -23,34 +23,34 @@
2323
- --output
2424
- json
2525
- --state
26-
- "{{ state_store }}"
27-
register: clusters_output
26+
- "{{ awx_kops_state_store }}"
27+
register: awx_clusters_output
2828
changed_when: false
2929
ignore_errors: true
3030
tags:
3131
- always
3232

3333
- name: Parse cluster names
3434
ansible.builtin.set_fact:
35-
existing_cluster_names: |
35+
awx_existing_cluster_names: |
3636
{{
37-
clusters_output.stdout |
37+
awx_clusters_output.stdout |
3838
from_json |
3939
community.general.json_query('[*].metadata.name')
4040
}}
4141
tags:
4242
- always
4343
when:
44-
- clusters_output.rc == 0
44+
- awx_clusters_output.rc == 0
4545

4646
- name: Import asynchronous AWX stack creation tasks
4747
ansible.builtin.import_tasks:
4848
file: create_async.yaml
4949
vars:
50-
cluster_names: |
50+
awx_cluster_names: |
5151
{{
52-
(runner_cluster_names + [head_cluster_name]) |
53-
difference(existing_cluster_names | default([]))
52+
(awx_runner_cluster_names + [awx_head_cluster_name]) |
53+
difference(awx_existing_cluster_names | default([]))
5454
}}
5555
tags:
5656
- create
@@ -59,19 +59,19 @@
5959
ansible.builtin.import_tasks:
6060
file: install_awx.yaml
6161
vars:
62-
cluster_name: "{{ head_cluster_name }}"
62+
cluster_name: "{{ awx_head_cluster_name }}"
6363
tags:
6464
- create
6565

6666
- name: Import asynchronous AWX stack deletion tasks
6767
ansible.builtin.import_tasks:
6868
file: delete_async.yaml
6969
vars:
70-
cluster_names: |
70+
awx_cluster_names: |
7171
{{
72-
existing_cluster_names |
72+
awx_existing_cluster_names |
7373
default([]) |
74-
intersect((runner_cluster_names + [head_cluster_name]))
74+
intersect((awx_runner_cluster_names + [awx_head_cluster_name]))
7575
}}
7676
tags:
7777
- delete

0 commit comments

Comments
 (0)