--- - name: "STRESS-CLEANUP: Remove info.json task files from workers" hosts: workers gather_facts: no vars_files: - "group_vars/all/vault.yml" pre_tasks: - name: Set inventory_env fact ansible.builtin.set_fact: inventory_env: "{{ inventory_file | basename | splitext | first | replace('inventory.', '') }}" - name: Load environment-specific variables ansible.builtin.include_vars: "{{ item }}" with_fileglob: - "group_vars/all/generated_vars{{ '.' + inventory_env if inventory_env else '' }}.yml" tasks: - name: Define the directory to be cleaned ansible.builtin.set_fact: target_dir: "{{ airflow_worker_dir }}/run/docker_mount/info_json_tasks/direct_docker_simulation" - name: "Display directory being cleaned" ansible.builtin.debug: msg: "Cleaning directory: {{ target_dir }} on {{ inventory_hostname }}" - name: Remove the info_json_tasks directory ansible.builtin.file: path: "{{ target_dir }}" state: absent become: yes - name: Recreate the info_json_tasks directory ansible.builtin.file: path: "{{ target_dir }}" state: directory owner: "{{ ansible_user }}" group: "{{ deploy_group }}" mode: '0755' become: yes - name: "Display cleanup completion" ansible.builtin.debug: msg: "Successfully cleaned and recreated {{ target_dir }} on {{ inventory_hostname }}"