generate config from template