In some scenarios I need to change the role of an instance from "both" or "server" to "client". However, the role does not remove the server.hcl file. As a result, when the service is restarted it still acts as a server
Steps to reproduce
Provision an initial cluster with more that one server. For example, 4 instances all configured to "both"
Check that the cluster has 4 servers and 4 clients
Change the inventory file so that the role of one of them is changed to "client"
Run the playbook
Expected results
The cluster now has 3 servers and 4 clients
Actual results
The cluster still has 4 servers and 4 clients
Root cause
The role only creates the server.hcl when needed, but does not verify its absent when it is not. The fix is to add a task that ensures absent if the instance is not a server. The same should be done for the client.hcl
Info
In some scenarios I need to change the role of an instance from "both" or "server" to "client". However, the role does not remove the server.hcl file. As a result, when the service is restarted it still acts as a server
Steps to reproduce
Expected results
The cluster now has 3 servers and 4 clients
Actual results
The cluster still has 4 servers and 4 clients
Root cause
The role only creates the server.hcl when needed, but does not verify its absent when it is not. The fix is to add a task that ensures absent if the instance is not a server. The same should be done for the client.hcl
I can open a PR for it