- name: Tidy up after p4benchmark scripts hosts: all remote_user: ir tasks: - name: Kill processes shell: pkill -9 locust ignore_errors: True - name: Check that the dir exists stat: path: /remote/p4-clients/work register: stat_result - name: Remove tmp dirs using fast remove shell: sudo mv /remote/p4-clients/work /remote/p4-clients/.fast-remove with_inventory_hostnames: irp210-h03 when: stat_result.stat.exists