added only_if statement to template deployment