diff --git a/roles/pi_musicmouse/tasks/main.yml b/roles/pi_musicmouse/tasks/main.yml index 85f77ca..7a418ff 100644 --- a/roles/pi_musicmouse/tasks/main.yml +++ b/roles/pi_musicmouse/tasks/main.yml @@ -46,6 +46,9 @@ ansible.builtin.stat: path: /opt/musicmouse/python-backend/pyproject.toml register: pi_musicmouse_pyproject + # Meaningless under --check on a host that has never been deployed: the git task + # above reports "changed" without writing anything, so there is nothing to stat. + when: not ansible_check_mode - name: Fail on a pre-rearchitecture checkout ansible.builtin.fail: @@ -57,7 +60,7 @@ mediapi_install_kidsmusic to false for this host and leave whatever is installed alone. Stopping here rather than failing three tasks deeper with the real reason buried. - when: not pi_musicmouse_pyproject.stat.exists + when: not ansible_check_mode and not pi_musicmouse_pyproject.stat.exists - name: Create virtualenv with Python {{ pi_musicmouse_python_version }} ansible.builtin.command: