"Works" in this case would mean that when you set ntp::service_enable:
false, on the next puppet run, the service would be disabled. If that's the
case, hiera is working and any errors are likely to do with typos or yaml
formatting issues with the other settings.


Rob Nelson
rnels...@gmail.com

On Wed, Jun 1, 2016 at 2:14 PM, Courtney Campbell <camp...@gmail.com> wrote:

> It does work, but it is not taking the setting in 6.yaml. It is setting
> the defaults.
>
> On Wednesday, June 1, 2016 at 11:58:26 AM UTC-5, Rob Nelson wrote:
>>
>> Can you show what happens on a brand new CentOS 6 or 7 node when you run
>> `puppet agent -t`? It should work the way you expect, though the
>> service_enable and service_ensure settings match the default, so there
>> won't be that much different.
>>
>> If it is working, but the output isn't clear on that, you could try
>> running puppet against it as is, then turn one of the service_* values to
>> false/stopped and you should see the state change. If it changes from
>> running to stopped, and back again if you revert the changes, you know
>> things are working. If not, it gets you closer to the issue.
>>
>>
>> Rob Nelson
>> rnel...@gmail.com
>>
>> On Wed, Jun 1, 2016 at 12:00 PM, Courtney Campbell <cam...@gmail.com>
>> wrote:
>>
>>> I just upgraded to puppet 3.8. Things I used to do in 3.7 like import
>>> and inherits no longer work. Anyway, I have been trying to figure out
>>> hiera. The docs on the site are great if you already know what you are
>>> doing. Anyway, I have environments setup. And have the hiera.yaml setup and
>>> working. Here is the hiera.yaml.
>>>
>>> ---
>>> :backends:
>>>   - yaml
>>> :yaml:
>>>   :datadir: "/etc/puppet/environments/%{::environment}/hieradata"
>>> :hierarchy:
>>>   - "nodes/%{::trusted.certname}"
>>>   - "%{::osfamily}/%{::operatingsystemmajrelease}"
>>>   - "virtual/%{::virtual}"
>>>   - "common"
>>>
>>>
>>> under my development einvironment I have
>>>
>>> RedHat/6.yaml
>>> RedHat/7.yaml
>>>
>>> 6.yaml has info for ntp and 7.yaml has info for chrony.
>>>
>>> 6.yaml
>>> ---
>>> ntp::restrict: 127.0.0.1
>>> ntp::service_enable: true
>>> ntp::service_ensure: running
>>> ntp::servers:
>>>   - ntp.server.com
>>>
>>> 7.yaml
>>> ---
>>> chrony::service_enable: true
>>> chrony::service_ensure: running
>>> chrony::servers:
>>>   - ntp.server.com
>>>
>>> That all looks fine and hiera test works.
>>> $ hiera ntp::service_enable ::environment=development ::osfamily=RedHat
>>> ::operatingsystemmajrelease=6
>>> true
>>>
>>> Now I am unsre how to make use of this in  my site.pp.
>>>
>>> I have this, but it is not working:
>>>
>>> if $operatingsystemmajrelease =~ '6' {
>>>    include ntp
>>> }
>>> elsif $operatingsystemmajrelease == '7' {
>>>    include chrony
>>> }
>>>
>>> It's setting the ntp.conf and chrony.conf files to the defaults. I
>>> really like puppet when it is working. But trying to figure this out is
>>> just pissing me off. I wish there was a doc that would hold my hand and
>>> just give exact examples on how to get this to work. It's not intuitive.
>>>
>>>
>>>
>>>
>>>
>>>
>>> --
>>> 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...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/puppet-users/62c54869-4f91-449f-bf31-3f720db862ab%40googlegroups.com
>>> <https://groups.google.com/d/msgid/puppet-users/62c54869-4f91-449f-bf31-3f720db862ab%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> 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/51dbad04-15e6-4600-824b-814f5beb9e98%40googlegroups.com
> <https://groups.google.com/d/msgid/puppet-users/51dbad04-15e6-4600-824b-814f5beb9e98%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> 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/CAC76iT85q4wHV_ofHF-%2BCfQosLJdtZ%3DvNFJ3iVX%2BZN0rQb-Ccg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to