fixes #6370 - automatically associate operating systems and templates