Okay I have progressed further with the help of the blog

my hiera.yaml looks like this 
---
:backends:
  - yaml

# Hierarchy
# First takes precedence ??? I think
:hierarchy:

  # node specific
  - "nodes/%{::trusted.certname}"

  # OS specific
  #- "environment/%{server_facts.environment}"
  - "%{::osfamily}"

  # common to all
  - common


:yaml:
# datadir is empty here, so hiera uses its defaults:
# - /etc/puppetlabs/code/environments/%{environment}/hieradata on *nix
# - %CommonAppData%\PuppetLabs\code\environments\%{environment}\hieradata 
on Windows
# When specifying a datadir, make sure the directory exists.
  :datadir:


# https://docs.puppet.com/hiera/3.1/configuring.html
:merge_behavior: deeper



i have <modulepath>/

hieradata/
hieradata/common.yaml
hieradata/RedHat.yaml


and in my sites.pp

# include hiera data
hiera_include(classes)


i do this found this nice tool to help with hiera

hiera  -d   classes   ::osfamily=RedHat environment=production

I get 
DEBUG: 2016-07-02 15:53:37 +1000: Hiera YAML backend starting
DEBUG: 2016-07-02 15:53:37 +1000: Looking up classes in YAML backend
DEBUG: 2016-07-02 15:53:37 +1000: Looking for data source RedHat
DEBUG: 2016-07-02 15:53:37 +1000: Found classes in RedHat
["profile::ybsshd"]


it doesn't go past RedHat.

if I remove the redhat.yaml file it will give me the common.yaml response.

I want hat is documented here
https://docs.puppet.com/hiera/3.1/lookup_types.html

i have the gem module installed 
deep_merge

I have checked this out , but don't think it covers it.
https://docs.puppet.com/hiera/3.2/complete_example.html


Alex




On Saturday, 2 July 2016 09:57:41 UTC+10, Alex Samad wrote:
>
> Hi
>
> Thanks for replying
>
> But I have been looking not saying it's not there but a quick URL to start 
> with might be helpful.
>
> There is lots of doco. I've done the learning vm twice but it didn't 
> answer the questions I'm looking
>
> Found this which seems to have all the answers for now 
> http://www.slashroot.in/puppet-hiera-tutorial-example-configuration
>
> A
>
> On 2 Jul 2016 1:00 AM, "Henrik Lindberg" <henrik.lindb...@puppet.com> 
> wrote:
>
>> On 01/07/16 06:20, Alex Samad wrote:
>>
>>> Hi
>>>
>>> I have in my common.yaml
>>>
>>> ---
>>> classes:
>>>   - ssh
>>>
>>>
>>>
>>> How do I say if the OS is linux then add that class ?
>>>
>>>
>> I think it is best if you try to read the documentation and look at 
>> tutorials. This very first step is clearly shown there.
>>
>> - henrik
>>
>> Thanks
>>> Alex
>>>
>>> --
>>> 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
>>> <mailto:puppet-users+unsubscr...@googlegroups.com>.
>>> To view this discussion on the web visit
>>>
>>> https://groups.google.com/d/msgid/puppet-users/dec0f7bf-b7cc-4f5e-8d90-3e49c4759e56%40googlegroups.com
>>> <
>>> https://groups.google.com/d/msgid/puppet-users/dec0f7bf-b7cc-4f5e-8d90-3e49c4759e56%40googlegroups.com?utm_medium=email&utm_source=footer
>>> >.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>> -- 
>>
>> Visit my Blog "Puppet on the Edge"
>> http://puppet-on-the-edge.blogspot.se/
>>
>> -- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "Puppet Users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/puppet-users/dMcleZNN3qE/unsubscribe.
>> To unsubscribe from this group and all its topics, 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/72ce74dc-e2f1-584b-0122-aa1e1f18c36f%40puppet.com
>> .
>> For more options, visit 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/97306492-9c15-4ca8-99fd-622f1f233dd7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to