voxpupuli / puppet-augeasproviders_sysctl

Augeas-based sysctl type and provider for Puppet
Apache License 2.0
10 stars 36 forks source link

Query: Set sysctl values using hiera #45

Open surajbora1 opened 4 years ago

surajbora1 commented 4 years ago

I would like to set multiple sysctl values using hiera, I have checked augeasproviders module, but it has dependencies on multiple module and my requirement is only sysctl. Is there any best way to to set sysctl values using hiera using augeasproviders_sysctl.

raphink commented 4 years ago

The dependencies to the augeasproviders module are soft, you don't need to install them all if you don't want to.

olevole commented 3 years ago

my hiera use case:

modules/profile/manifests/sysctl.pp:

class profile::sysctl (
    $entries = {},
) {
  create_resources('sysctl', $entries)
}

in the role yaml:

classes:
  - profile::sysctl 

profile::sysctl::entries:
  net.ipv4.tcp_rmem:
    value: 4096 87380 16777216
  net.ipv4.tcp_wmem:
    value: 4096 65536 16777216
  net.core.rmem_max:
    value: 16777216
raphink commented 3 years ago

The augeasproviders modules has augeasproviders::instances for that:

You'll just need to use the augeasproviders::instances::sysctl_hash key in hiera.