I don't see any reason those wouldn't work, but there must be something.
I tend to use this format as I find it more compact.
if (['dbm','dbs']).include? @role -%>
fwiw, it might be better to move the data into Hiera and skip the if
statements altogether.
Ramin