- name: Destroy lab instances in AWS
  hosts: localhost
  connection: local
  become: no
  gather_facts: yes

  vars:
    ec2_exact_count: 0
    ec2_wait: no

  roles:
    - manage_ec2_instances

  post_tasks:
    - name: Find .txt files
      find:
        paths: "{{ ansible_env.PWD }}"
        patterns: '*.txt'
      register: files

    - name: Remove inventory files
      file:
        state: absent
        path: "{{ item }}"
      with_items: "{{ files.files }}"

- name: Destroy lab instances in AWS
  hosts: localhost
  connection: local
  become: no
  gather_facts: yes

  vars:
    ec2_exact_count: 0
    ec2_wait: no

  roles:
    - manage_ec2_instances

  post_tasks:
    - name: Remove inventory files
      shell: rm -vf {{ playbook_dir }}/*.txt
      register: removal
      changed_when: removal.stdout_lines | length > 0

Switch back to using shell task to remove inventory files
Switch back to using shell task to remove inventory files

For large numbers of inventory files, using shell is orders of magnitude faster.
