You can come close to 23:00 (+- 30 seconds) with this
{{ ((lookup('pipe', 'date --date 23:00 +%s') | int - lookup('pipe', 'date +%s') | int) / 60) | round | int }}
and units set to minutes.
An alternative is to run the at command with the shell module.
Thank you both for the suggestions. And thanks for the pointer to the modified module. I’m not sure I’m allowed to install it, but maybe I can find a machine to try it out on.
I’ve actually decided for a few reasons that, in this particular case, a shell script will work better than an ansible playbook. But I will keep your ideas in mind the next time this comes up.
I’ve also submitted a feature request to the github thing.