Roles inside policy files

Hi,

I just started looking into Policyfiles and it works really well in testkitchen environments when using recipes or cookbooks. When using a role inside the Policyfile run_list I get this error:
Error: Failed to generate Policyfile.lock
Reason: (Solve::Errors::NoSolutionError) Unable to satisfy the following requirements:

  • jdk8 (>= 0.0.0) required by user-specified dependency

am I not supposed to use roles inside Policyfiles ?

Hi ann! That’s correct, you are not supposed to use roles inside policyfiles. You assign policyfiles to a role, but they shouldn’t be referenced within the policyfile itself.

I assume you’ve already been there, but here’s a link to our docs. https://docs.chef.io/policyfile/

Thank you .
Can you explain how and use cases when policyfiles are assigned to a role ?
I cant see an example of it.