Command line switch to restart a container

I’d like to have a switch in HA that when it goes to on it sends a command line command to restart my prowlarr container.

I was hoping it was a simple as sending the docker restart prowlarr command as I can via terminal when connected to the HA machine, but it doesn’t restart the container.

command_line:
  - switch:
      name: Prowlarr_Restart
      command_on: /bin/bash -c "docker restart prowlarr"

Does the process have enough rights to even do the restart ?

I’m not sure, but also tried sudo and it didn’t work either. Which user should be in the sudoer list?

The system user that is running HA.

Or try this:
https://www.cyberciti.biz/open-source/command-line-hacks/linux-run-command-as-different-user/

That way you could use a existing user that has the rights