You'd better use [```union()```][1] in your conditions earlier instead of joining to a string then splitting again

[1]: https://github.com/puppetlabs/puppetlabs-stdlib#union