I've already had to do something similar, and did it the following way :
* A single "role=" fact/variable.
* Conditionals such as "if "<rolename>" in $role { ..."
It's not the prettiest way, but since facts can't be arrays, it's the
best I could think of. My role names are all 3 letter long and unique,
meaning that no role name contains another (role "app" and "app1"
would cause "app" to be found in "app1).
In hiera (or from a fact) I just need to have a role string :
role: 'role1,role2,role3'
Depending on your environment, it might also make sense to go for
completely separate variables for each role, such as:
webserver: true
appserver: true
With matching facts which exist or don't exist.
HTH,
Matthias
--
Matthias Saou ██ ██
██ ██
Web:
http://matthias.saou.eu/ ██████████████
Mail/XMPP:
matt...@saou.eu ████ ██████ ████
██████████████████████
GPG: 4096R/E755CC63 ██ ██████████████ ██
8D91 7E2E F048 9C9C 46AF ██ ██ ██ ██
21A9 7A51 7B82 E755 CC63 ████ ████