Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recent changes makes module non-idempotent. #40

Open
gapotts opened this issue Feb 16, 2016 · 4 comments
Open

Recent changes makes module non-idempotent. #40

gapotts opened this issue Feb 16, 2016 · 4 comments

Comments

@gapotts
Copy link

gapotts commented Feb 16, 2016

A recent change to this module makes it non-idempotent for some values.

Example:

Notice: /Stage[main]/Sysctl::Base/Sysctl[kernel.sem]/Exec[enforce-sysctl-value-kernel.sem]/returns: executed successfully
Notice: /Stage[main]/Sysctl::Base/Sysctl[net.ipv4.ip_local_port_range]/Exec[enforce-sysctl-value-net.ipv4.ip_local_port_range]/returns: executed successfully

This notice happens on every puppet run.

My hiera data looks like:


---
sysctl::base::values:
  kernel.shmmax:
    value: 68719476736
  kernel.shmall:
    value: 4294967296
  fs.aio-max-nr:
    value: 1048576
  fs.file-max:
    value: 6815744
  kernel.shmmni:
    value: 4096
  kernel.sem:
    value: 250 32000 100 128
  net.ipv4.ip_local_port_range:
    value: 9000 65500
  net.core.rmem_default:
    value: 262144
  net.core.rmem_max:
    value: 4194304
  net.core.wmem_default:
    value: 262144
  net.core.wmem_max:
    value: 1048576

I am running R10k and am currently working around the issue by pinning my version number to 1.0.2. I'm not sure at what version this actually started to happen since I haven't had time go test this on the versions in between, but I'm sure others are likely to hit this at some point.

Regards -Greg

@gapotts gapotts changed the title Recent changes make module non-idempotent. Recent changes makes module non-idempotent. Feb 16, 2016
@thias
Copy link
Owner

thias commented Feb 16, 2016

See #38 for some details. I agree that this is annoying, but it's a nice feature to have values enforced by default, and the real problem lies in the fact that sysctl is quite relaxed when it comes to setting them vs. having one single output (regarding tabs vs. spaces)....

So in your case, and for anyone else noticing the same, I see two easy solutions :

  1. Make sure your value has the exact same string that sysctl reports. In your case it means single quoting it (you should already be doing that) and separating the values with tabs :
  kernel.sem:
    value: '250 32000   100 128'

Maybe "250\t32000\t100\t128" works, I haven't tested.

  1. Disabling the enforcing feature for that particular sysctl entry :
  kernel.sem:
    value: '250 32000 100 128'
    enforce: false

If you have some rock solid code to contribute in order to have that enforcing work properly with whatever tabs vs. spaces combination, that would also work :-)

@gapotts
Copy link
Author

gapotts commented Feb 18, 2016

Ok. I see what is being done and why & will adjust accordingly. Is it possible to get this added to the docs so others don't have to delve into the issues to discover this feature?

@dannygoulder
Copy link

I can confirm that using tabs to separate makes it work.

@nomoresecrets
Copy link

using tabs ("\t") for "kernel.sem" and "net.ipv4.ip_local_port_range" works for me too, although it's not that pretty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants