Ask Your Question
0

hiera with fiddyspence/sysctl

asked 2015-02-16 15:38:23 -0500

EricL gravatar image

Hi, I've installed fiddyspence-sysctl and I'm trying to make it work within my existing Hiera setup, which I know is working, just not with this module so far for me.

hiera.yaml:

---
:backends:
 - yaml
:yaml:
 :datadir: /etc/puppet/environments/%{environment}/data
:hierarchy:
 - "node/%{::fqdn}"
 - "roles/%{role}"
 - common

/etc/puppet/environments/ENV/data/roles/prod.yaml:

---
classes:
 - ntp
 - sysctl
ntp::driftfile: "/var/lib/ntp/FOOdrift"
sysctl::kernel.core_uses_pid:
 ensure: 'present'
 permanent: true
 value: 0
sysctl::fs.suid_dumpable:
 ensure: 'present'
 permanent: true
 value: 2

The ntp driftfile value is in there so I can verify that the value is correctly read and then set by the agent on the node matching this role (it is). But I've tried various configurations of the sysctl parameter name and values. I get no errors, and nothing is done on my agent either. The catalog runs and does nothing. Hiera on the command line gives me this:

# hiera sysctl::fs.suid_dumpable ::fqdn=node.domain.com role=prod environment=ENV
{"value"=>2, "ensure"=>"present", "permanent"=>true}

# hiera sysctl::kernel.core_uses_pid ::fqdn=node.domain.com role=prod environment=ENV
{"ensure"=>"present", "value"=>0, "permanent"=>true}

I'm stumped, and guessing that I'm missing something fundamental here. Would appreciate any help.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-02-20 13:01:32 -0500

GregLarkin gravatar image

As far as I know, you cannot automatically bind Hiera data to this sysctl resource without using an intermediate wrapper class. I think you might be able to if the sysctl module provided a defined type, but looking at the code, it's implemented as a pure Ruby type and provider.

edit flag offensive delete link more

Comments

Thank you very much for your help and support. This makes more sense to me now.

EricL gravatar imageEricL ( 2015-02-20 14:34:03 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2015-02-16 15:38:23 -0500

Seen: 510 times

Last updated: Feb 20 '15