I did just that, used a template to populate some external facts:

[root@host123cluster123 ~]# cat /etc/facter/facts.d/inventory.txt 
cluster=123
servertype=typename
stype=typename
datacenter=dcname
owner=groupname

[puppet exp] $ cat inventory.erb 
<%# these will be blank if the variable does not exist -%>
<%# next 4 are set in cobbler's kickstart metadata -%>
cluster=<%= @cluster %>
servertype=<%= @stype %>
stype=<%= @stype %>
datacenter=<%= @datacenter %>
owner=<%= @owner %>

These end up in puppetdb and are available to mcollective when the usual 
collections happen. I haven't noticed any adverse effects from doing it this 
way.

On Fri, Apr 17, 2015 at 11:02:03AM -0500, Brandon Metcalf wrote:
>    Is it possible to reference a top scope variable passed in from an ENC and
>    set a fact based on that?  That is,
>    parameters:
>      var: value
>    I know it's the other way around that top scope variables are set from
>    facts, but just trying to figure out the best way to do this other that
>    writing out a script to set an external fact on the next puppet run.
>    Thanks.
> 
>    --
>    You received this message because you are subscribed to the Google Groups
>    "Puppet Users" group.
>    To unsubscribe from this group and stop receiving emails from it, send an
>    email to [1]puppet-users+unsubscr...@googlegroups.com.
>    To view this discussion on the web visit
>    
> [2]https://groups.google.com/d/msgid/puppet-users/CAHSDT%3DSMQGQbGDJs-MXABgdwvHgPf-yoOyE4xSZnjsG9gXw7HA%40mail.gmail.com.
>    For more options, visit [3]https://groups.google.com/d/optout.
> 
> References
> 
>    Visible links
>    1. mailto:puppet-users+unsubscr...@googlegroups.com
>    2. 
> https://groups.google.com/d/msgid/puppet-users/CAHSDT%3DSMQGQbGDJs-MXABgdwvHgPf-yoOyE4xSZnjsG9gXw7HA%40mail.gmail.com?utm_medium=email&utm_source=footer
>    3. https://groups.google.com/d/optout

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/20150417163115.GA1359%40iniquitous.heresiarch.ca.
For more options, visit https://groups.google.com/d/optout.

Reply via email to