# Revision history [back]

The common solution that I see is to use Hiera's APL to fill in the parameters of your profiles, and only 'include myprofile' in the roles. You would then use something like this in hiera..

---
:backends
- yaml
:hierarchy:
- "role/%{::my_role}"
- defaults
:yaml


Usually this is done with an approach where you don't have any value at all in your profile parameters, and you fill them in the defaults.yaml file.

Then if you have a role specific override that you do, you create hieradata/role/myspecialrole.yaml that contains the override

The common solution that I see is to use Hiera's APL to fill in the parameters of your profiles, and only 'include myprofile' in the roles. You would then use something like this in hiera..

---
:backends
- yaml
:hierarchy:
- "role/%{::my_role}"
- defaults
:yaml


Usually this is done with an approach where you don't have any value at all in your profile parameters, and you fill them in the defaults.yaml file.

Then if you have a role specific override that you do, you create hieradata/role/myspecialrole.yaml that contains the override

Given your above set of roles/profiles

class profiles::apache_reverse_proxy($context = "/") { // use puppet::apache to configure reverse proxy on$context
}

class profiles::jenkins() {
// configure jenkins only (not apache)
}

class roles::jenkins_master() {
include profiles::base_server
include profiles::java8
include profiles::apache_reverse_proxy  // <-- how to set reverse proxy \$context as "/jenkins"
include profiles::jenkins
}


You would then have the following hiera configuration

#hieradata/role/jenkins_master.yaml
---
profiles::apache_reverse_proxy::context: '/jenkins'