is there a way to make template for set of nodes?
You can't do like you explain.

What you can do instead is to add a custom template suggestion for the specific nodes in the preprocess_node function to make the nodes use a specific template that can have any name.