Hi Garrett et all.

Thanks for your thoughts and examples. I forgot to mention and I have
in my top level site.pp only
 hiera_include('classes')
and the rest it's in the hiera.yaml mentioned above and so far so good.
I was just wondering if it's one way to go and it seems to be right.

I love Puppet and Hiera....

Thanks guys again




On Fri, Mar 20, 2015 at 1:28 AM, Garrett Honeycutt
<g...@garretthoneycutt.com> wrote:
> On 3/19/15 12:07 AM, Alfredo De Luca wrote:
>> Hi all.
>> I am testing hiera in our enviroment and I wonder if I can manage
>> everything from hiera without using the main site.pp.
>>
>> Do you think is the right way? or I should use site.pp as well?
>>
>>
>> Here is what I am testing and so far so good.
>>
>> --------- hiera.yaml
>> ---
>> :backends:
>>  - yaml
>>
>> :hierarchy:
>>  - "environments/%{::environment}"
>>  - "nodes/%{::fqdn}"
>>  - common
>>
>> :yaml:
>>  :datadir: /etc/puppet/hieradata/
>>
>>
>> --------- hiera.yaml
>>
>> --------- common.yaml
>> ---
>> classes:
>>  - ntp
>>  - resolver
>>  - yum
>>  - motd
>>
>> ntp::restrict:
>> ntp::autoupdate: false
>> ntp::service_enable: true
>> ntp::service_ensure: running
>> ntp::servers:
>>  - 10.4.123.3
>>  - 10.4.123.4
>>  - 10.5.123.3
>>  - 10.5.123.4
>>
>> resolver::search:
>>  - xxx.xxx.com
>>  resolver::dns_servers:
>>  - 10.4.17.18
>>  - 10.4.17.20
>>  - 10.5.17.18
>>  - 10.5.17.20
>>
>> yum::source_repo_dir: 'puppet:///REPO_FILES/'
>> yum::clean_repos: true
>>
>> motd::content: '##### TEST #####'
>> --------- common.yaml
>>
>>
>>
>
> Hi Alfredo,
>
> Here is a link[1] to the site manifest that I use. Everything else is
> driven through Hiera. Your hierarchy should be ordered such that the
> most specific level is first and each subsequent level describes your
> systems with less specificity. So the fqdn level should be swapped with
> the environment. Here is a link[2] to a good starting point for your
> hiera configuration.
>
> If you were to visualize the number of keys in each level of the
> hierarchy it would appear as a pyramid with the the top having the
> fewest keys and the bottom having the most. If you find that's not the
> case, it is a good sign to refactor your hiera levels.
>
> [1] - https://gist.github.com/ghoneycutt/14855c4890cb400165f3
> [2] - https://gist.github.com/ghoneycutt/5b6034f9bb381c56a950
>
> Best regards,
> -g
>
> --
> Garrett Honeycutt
> @learnpuppet
> Puppet Training with LearnPuppet.com
> Mobile: +1.206.414.8658
>
> --
> 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/550ADCFB.8020705%40garretthoneycutt.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
Alfredo

-- 
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/CAAWpFTEfdsQn6YrW43tW%3Dm69QV7JQ82%2BOoV91zyigaS09A%2BfGg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to