# sysctl module: check parameter value before changing it

**URL:** <https://forum.ansible.com/t/sysctl-module-check-parameter-value-before-changing-it/22504>\
**Category:** Ansible Project\
**Created:** [September 7, 2016, 9:41am UTC](https://forum.ansible.com/t/sysctl-module-check-parameter-value-before-changing-it/22504 "2016-09-07T09:41:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Felix\_Paetow](https://avatars.discourse-cdn.com/v4/letter/f/f14d63/32.png) [@Felix\_Paetow](https://forum.ansible.com/u/Felix_Paetow)\
**Post date:** [September 7, 2016, 9:41am UTC](https://forum.ansible.com/t/sysctl-module-check-parameter-value-before-changing-it/22504/1 "2016-09-07T09:41:27Z")

</div>

Hi together,

at the moment I want to change some parameter values in sysctl.conf via sysctl, but I want to change them only when they are under my minimum requirements.

By now, I think the only way of doing so is to define two tasks:

- one debug task to register a variable with the value of the specific parameter
- and one sysctl task with a when statement checking this parameter

The reason why I want to check the parameters for a minimum value is that I’m not and won’t be an expert for every parameter in this configuration file. I think  
the developers and maintainers of the various distributions know much better than I what they are doing when setting a specific value. So I don’t want to overwrite it with my minimum requirements.

Do you know a better or at least a default way to check the parameter value before setting it?

Thanks for your help and best regards,  
Felix
