I’m currently doing something very similar, just using lineinfile module to add/remove ‘down’ from current host in upstream entry.
I’ve been thinking of using a sort of upstream-enabled directory that contains .conf files for each server on the backend. Then you just add/remove conf files in that directory and reload to add/remove servers to the balancer. I haven’t done this or tested it yet though. I may produce some issues.
Another idea is that if you use the template module, you could use the ‘set_fact’ module new in 1.2 to set the variable to the host to ‘down’ (assuming a default of ‘up’) and then the template could just walk over all hosts in the group.