--- - name: Unmount Filesystem tags: teardown block: - name: Unmount filesystem on os-transfer ansible.posix.mount: src: "//{{ hostvars[inventory_hostname].ansible_host }}/File_Transfer" path: "{{ mount_directory }}" opts: "credentials={{ credentials_path }},iocharset=utf8" state: absent fstype: cifs register: mount_status failed_when: mount_status.changed == false - name: Remove smb-credential template file: path: "{{ credentials_path }}" state: absent delegate_to: os-transfer