Hi

Very strange, edited hiera.yaml. ended up not makeing any changes - 
restarte puppet server 

and it seems to be working !

sigh ...

A

On Thursday, 21 July 2016 10:32:16 UTC+10, Alex Samad wrote:
>
> Hi
>
> So i think I have worked out the issue
>
> the params sections is setting puppet variables ... looks like that is 
> happening after the hiera lookups are done.
>
> so environment: production is done before hiera.
>
> so how do I set variables in the enc that are used by hiera ?
>
> A
>
>
>
> On Thursday, 21 July 2016 09:32:41 UTC+10, Alex Samad wrote:
>>
>> Hi
>>
>> Using an ENC
>>
>> /usr/local/bin/puppet_node_classifier abc.abc.com
>> ---
>> environment: production
>> parameters:
>>   pp_ybenv: alex
>>   pp_yblocation: ybo
>>
>>   
>>   
>> from hiera.yaml
>>
>>   
>> :hierarchy:
>>
>>   # node specific
>>   - "nodes/%{::trusted.certname}"
>>
>>   
>>   # Envornment 
>>   - "ybenv/%{::pp_ybenv}"
>>
>>   # OS specific
>>   - "os/%{::osfamily}"
>>
>>   # common to all
>>   - common
>>
>>   
>> I create a file /etc/ybenv which records $pp_ybenv and it gets set to alex
>>
>>
>> but my file
>>
>> hieradata/ybenv/alex.yaml
>>
>> doesn't get read ?
>>
>>
>> I set this  in alex.yaml
>>
>> hr_motd_content: ">>>>>>> alex environment <<<<<<<<<<"
>>
>>
>> use it in a class like this 
>>
>>
>>
>>   $pp_motd_content_array =hiera_array( 'hr_motd_content', [] )
>>   $pp_motd_content = join( $pp_motd_content_array, "
>> ")
>>
>>
>> [...]
>>
>>
>>   class { 'motd' :
>>
>>     content =>
>> "Server build V1.6
>> $pp_motd_content
>> You are logging into ${trusted['certname']} Environment [$pp_ybenv]
>> "
>>
>>
>>   }
>>
>>
>> if I add the same info to a node specific file or the common.yaml 
>>
>> it show up.. for some reason hiera is not looking at pp_ybenv 
>>
>>
>>

-- 
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/c2e812a3-8627-44d3-98e4-bc4f9b60bf95%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to