Hi Kimo
>
> I'm using puppet enterprise 3 with hiera and roles/profiles. I'm trying
> to find a good way to handle some facts (namely role) being generated on
> the master and sourced based on the underlying hypervisor. I.e., if the
> node is running on EC2 then the role would be from a tag, for vSphere
> the role would come from either a tag or custom attribute, etc, and a
> fallback would be to just take the first part of the hostname minus any
> number (e.g.,
web1.colo.domain.com would be web).
You can define $role in site.pp (manifests/site.pp) of your environment.
if defined outside the "node" definitions, it will be a top-scope
variable.
You can make decisions based on facts and set $role accordingly your
needs.
https://docs.puppetlabs.com/pe/latest/
puppet_assign_configurations.html#assigning-configuration-data-with-the-
site-manifest-sitepp
- Thomas