Move logic from template to puppet-setup