I have a role that can be run against both WIndows and Linux hosts. It has a handler for restarting a service on windows using win_service
. This is breaking ansible-pull for us:
ansible-pull[7939]: ERROR! couldn't resolve module/action 'win_service'. This often indicates a misspelling, missing collection, or incorrect module path.
ansible-pull[7939]: The error appears to be in 'roles/ups/handlers/main.yml': line 11, column 3, but may
Sep 12 09:16:51 ansible-pull[7939]: be elsewhere in the file depending on the exact syntax problem.
Sep 12 09:16:51 ansible-pull[7939]: The offending line appears to be:
Sep 12 09:16:51 ansible-pull[7939]: become: yes
Sep 12 09:16:51 ansible-pull[7939]: - name: "windows restart nut service"
Sep 12 09:16:51 ansible-pull[7939]: ^ here
because we do not install the ansible windows collection on the Linux hosts, and I would prefer not to. Is there any way I can avoid the need to resolve the win_service action on the Linux hosts?