It is unnecessary maintaining a list of parameters which require a restart, as you can tell by looking at pg_settings.
The way I do it is by comparing the contents of pg_settings with a snapshot I made just after (or just before) the server was last restarted. If any settings have been changed that have a context of 'postmaster', the server needs a restart.
It's not as easy as it sounds to do that with Ansible, since you don't magically get a list of parameters which are changed from last time. All parameters are in a template which generates postgresql.conf, so you just get the information that that file changed, that is why you need to compare each parameter separately. Since it is a lot faster to compare just a few parameters which we set that require a restart, it is worth keeping a list.
If anyone is interested this is how I detect if a server needs a restart. I define a dict with parameters that require a restart and set the keys to have values of the current variables: