Move all configuration into template

This allows a single action to trigger restarting elasticsearch if any
configuration changes. Also, it's simpler in terms of what variables
mean and how they influence the config.

This change effectively makes this role more idempotent so you can run
it multiple times and once the config has been written once, it'll not
change on the next run, meaning Elasticsearch only gets restarted when
something actually changes.