- name: "Lookup for {{ item }} directory" stat: path: "{{ desktop.old_source_dir }}/{{ item }}" register: old_directory - name: "Move {{ desktop.old_source_dir }}/{{ item }} to {{ desktop.apps_source_dir }}/{{ item }}" command: mv {{ desktop.old_source_dir }}/{{ item }} {{ desktop.apps_source_dir }}/{{ item }} when: - old_directory.stat.exists