Closed Daenou closed 2 years ago
I wasn't aware that you fixed this already and tried hard to reproduce :rofl: .
But I actually found a 2nd place to add this. Only now it is ignored twice:
TASK [snapclient : Enable and start snapclient@ services] ****************************************************************************************************************************************************************************
failed: [pidev] (item=pidev) => {"ansible_loop_var": "item", "changed": false, "item": {"name": "pidev", "snapclient_sink": "dmix:CARD=sndrpihifiberry,DEV=0", "snapclient_snapserver": "pidev"}, "msg": "Could not find the requested service snapclient@pidev.service: host"}
failed: [pidev] (item=hifi) => {"ansible_loop_var": "item", "changed": false, "item": {"name": "hifi", "snapclient_sink": "dmix:CARD=sndrpihifiberry,DEV=0", "snapclient_snapserver": "hifi"}, "msg": "Could not find the requested service snapclient@hifi.service: host"}
...ignoring
RUNNING HANDLER [snapclient : Restart snapclients] ***********************************************************************************************************************************************************************************
failed: [pidev] (item=pidev) => {"ansible_loop_var": "item", "changed": false, "item": {"name": "pidev", "snapclient_sink": "dmix:CARD=sndrpihifiberry,DEV=0", "snapclient_snapserver": "pidev"}, "msg": "Could not find the requested service snapclient@pidev.service: host"}
failed: [pidev] (item=hifi) => {"ansible_loop_var": "item", "changed": false, "item": {"name": "hifi", "snapclient_sink": "dmix:CARD=sndrpihifiberry,DEV=0", "snapclient_snapserver": "hifi"}, "msg": "Could not find the requested service snapclient@hifi.service: host"}
...ignoring
Probably applies to these files too:
roles/acable/tasks/main.yml
roles/acable/handlers/main.yml
Is fixed in the above files. But today I found out that also e.g. this one gives a fatal error in check mode:
TASK [snapclient : Disable upstream systemd unit] *********************************************************
fatal: [hifi]: FAILED! => {"changed": false, "msg": "Could not find the requested service snapclient.service: host"}
So my assumption above that only "looped" services are affected, was completely wrong. We need to make all ansible.builtin.systemd:
occurrences failsafe. :frowning_face:
Added the ignore_errors to every systemd task.
Added some more and merged.
When trying out your new snapclient structure with --check and --diff my playbook cancelled after
TASK [snapclient : Enable and start snapclient@ services]
as it failed because it couldn't check if it would work as the services don't exist yet:So we should make sure that every task that relies on a file or systemd unit being present either is handled in check mode so the check mode runs through