Automatic index template upload on newly created cluster

I've been using configuration management tools (more recently Saltstack) to automatically deploy ES clusters.
I used to have an index mapping template in the config directory and when the cluster started and a document was indexed the template was picked up.
Starting with ES 2.0 file based templates are not supported anymore so I need to wait for the cluster to come up and then upload a template.
Is there a recommended way to find out when the cluster is ready to receive the template?
How do I keep the cluster from indexing documents until all changes have been applied?

Dado Feigenblatt

Just ping _cat/health and wait for it to hit green.

How do you do it now

Thanks for the reply @warkolm
I've been using file based templates so when the ES cluster comes up the templates are immediately available for any new index.
I have tens of thousands of processes which are indexing logs, stats and metadata.
They do asynchronous posts and fail gracefully if ES is down, but start posting immediately when ES comes up.
That's why I need the index templates to be available immediately.
Now I'm leaning towards adding logic to my RESTful application that's fronting the ES cluster.
When the REST app comes up it will first make sure the indices are configured as needed.
I wonder how Marvel, Logstash, and other apps handle this.