Specifically, an elasticsearch cluster, but doing this the right way would also apply to other kinds of clusters, like RabbitMQ or Redis.
I'm using
https://github.com/LaneCommunityCollege/aspects_elasticsearch to manage my elasticsearch cluster. Currently, if I modify the configuration settings, Ansible would issue a restart to all the nodes in the cluster.
The obvious answer is to only run the playbook on one node at a time.
But there are situations where that isn't convenient. If I run Ansible
like a puppet agent then setting the configuration setting in the
group_vars file will apply it on all the nodes, thus restarting them
all. Or if I have a large number of nodes. Or simply need to apply the
change, but don't have time to do it one or two nodes at a time.
The other solutions I've thought of involve custom scripts that would not be part of the Ansible playbook. And likely be application specific.
Is there a way to tell ansible to set a service restart task sometime in the future? Say, right now for node1, 5 minutes later for node2, 10 minutes later for node3, and so on.
Maybe the at module? How would it know to set it 10 minutes in the future instead of 5 for the third node?
So, yeah, is there a good Ansible specific method for this? Or do I need to look outside of Ansible?