You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
508B

  1. ---
  2. - name: get processes using /target
  3. command: lsof -t {{item}}
  4. register: get_target_processes
  5. loop: "{{ remaining_target_mounts }}"
  6. failed_when: false
  7. changed_when: false
  8. - name: kill every process still running in /target
  9. command: kill -KILL {{item}}
  10. loop: "{{ get_target_processes | json_query(\"results[].stdout_lines|[]\") | unique }}"
  11. failed_when: false
  12. - name: unmount /target filesystems
  13. mount:
  14. path: "{{item}}"
  15. state: unmounted
  16. loop: "{{ remaining_target_mounts }}"