Fixed linting errors

This commit is contained in:
Michael Hollister 2023-06-22 19:32:22 -05:00
parent b3655f439c
commit 56880ad220
3 changed files with 17 additions and 23 deletions

View File

@ -9,6 +9,7 @@
- ansible.builtin.set_fact: - ansible.builtin.set_fact:
matrix_synapse_enabled_worker_names: "{{ matrix_synapse_workers_enabled_list | map(attribute='name') }}" matrix_synapse_enabled_worker_names: "{{ matrix_synapse_workers_enabled_list | map(attribute='name') }}"
matrix_synapse_worker_template_job_status_result_list: []
# This also deletes some things which we need. They will be recreated below. # This also deletes some things which we need. They will be recreated below.
- name: Ensure unnecessary worker configs are cleaned - name: Ensure unnecessary worker configs are cleaned
@ -45,11 +46,9 @@
with_items: "{{ matrix_synapse_workers_enabled_list }}" with_items: "{{ matrix_synapse_workers_enabled_list }}"
loop_control: loop_control:
loop_var: matrix_synapse_worker_details loop_var: matrix_synapse_worker_details
index_var: worker_template_creation_index
- name: Check status of worker systemd service files and configuration files creation - name: Check status of worker systemd service files and configuration files creation
ansible.builtin.include_tasks: "{{ role_path }}/tasks/synapse/workers/util/worker_setup_job_cleanup.yml" ansible.builtin.include_tasks: "{{ role_path }}/tasks/synapse/workers/util/worker_setup_job_cleanup.yml"
with_items: "{{ matrix_synapse_workers_enabled_list }}" with_items: "{{ matrix_synapse_worker_template_job_status_result_list }}"
loop_control: loop_control:
loop_var: matrix_synapse_worker_details loop_var: matrix_synapse_worker_template_job_status
index_var: worker_template_job_status_index

View File

@ -29,6 +29,7 @@
become: false become: false
async: 60 async: 60
poll: 0 poll: 0
changed_when: false
- name: Ensure systemd service exists for {{ matrix_synapse_worker_systemd_service_name }} - name: Ensure systemd service exists for {{ matrix_synapse_worker_systemd_service_name }}
ansible.builtin.command: > ansible.builtin.command: >
@ -64,11 +65,13 @@
become: false become: false
async: 60 async: 60
poll: 0 poll: 0
changed_when: false
# Create unique variable identifiers for checking job status later # Store job status results for checking later
- ansible.builtin.set_fact: - ansible.builtin.set_fact:
"{{ item.name }}": "{{ item.val }}" matrix_synapse_worker_template_job_status_result_list: "{{ matrix_synapse_worker_template_job_status_result_list + [item] }}"
when: item.name not in vars
with_items: with_items:
- { name: "configuration_result_{{ worker_template_creation_index }}", val: "{{ configuration_result }}" } - result:
- { name: "service_result_{{ worker_template_creation_index }}", val: "{{ service_result }}" } name: "{{ matrix_synapse_worker_details.name }}"
configuration: "{{ configuration_result }}"
service: "{{ service_result }}"

View File

@ -1,11 +1,9 @@
--- ---
# Clean up Ansible controller temp files as a result of spawning async tasks # Clean up Ansible controller temp files as a result of spawning async tasks
- name: Check job status for configuration file {{ matrix_synapse_worker_details.name }} - name: Check job status for configuration file {{ matrix_synapse_worker_template_job_status.result.name }}
vars:
worker_configuration_result: "{{ lookup('ansible.builtin.vars', 'configuration_result_' + worker_template_job_status_index|string) }}"
ansible.builtin.async_status: ansible.builtin.async_status:
jid: "{{ worker_configuration_result.ansible_job_id }}" jid: "{{ matrix_synapse_worker_template_job_status.result.configuration.ansible_job_id }}"
register: configuration_status register: configuration_status
until: configuration_status.finished until: configuration_status.finished
retries: 60 retries: 60
@ -13,11 +11,9 @@
delegate_to: localhost delegate_to: localhost
become: false become: false
- name: Check job status for service file {{ matrix_synapse_worker_details.name }} - name: Check job status for service file {{ matrix_synapse_worker_template_job_status.result.name }}
vars:
worker_service_result: "{{ lookup('ansible.builtin.vars', 'service_result_' + worker_template_job_status_index|string) }}"
ansible.builtin.async_status: ansible.builtin.async_status:
jid: "{{ worker_service_result.ansible_job_id }}" jid: "{{ matrix_synapse_worker_template_job_status.result.service.ansible_job_id }}"
register: service_status register: service_status
until: service_status.finished until: service_status.finished
retries: 60 retries: 60
@ -26,19 +22,15 @@
become: false become: false
- name: Cleanup job result for configuration file - name: Cleanup job result for configuration file
vars:
worker_configuration_result: "{{ lookup('ansible.builtin.vars', 'configuration_result_' + worker_template_job_status_index|string) }}"
ansible.builtin.async_status: ansible.builtin.async_status:
jid: "{{ worker_configuration_result.ansible_job_id }}" jid: "{{ matrix_synapse_worker_template_job_status.result.configuration.ansible_job_id }}"
mode: "cleanup" mode: "cleanup"
delegate_to: localhost delegate_to: localhost
become: false become: false
- name: Cleanup job result for service file - name: Cleanup job result for service file
vars:
worker_service_result: "{{ lookup('ansible.builtin.vars', 'service_result_' + worker_template_job_status_index|string) }}"
ansible.builtin.async_status: ansible.builtin.async_status:
jid: "{{ worker_service_result.ansible_job_id }}" jid: "{{ matrix_synapse_worker_template_job_status.result.service.ansible_job_id }}"
mode: "cleanup" mode: "cleanup"
delegate_to: localhost delegate_to: localhost
become: false become: false