# Ansible 2.2 - multi sysctl entry addition issue

**URL:** <https://forum.ansible.com/t/ansible-2-2-multi-sysctl-entry-addition-issue/27779>\
**Category:** Ansible Project\
**Created:** [June 12, 2018, 2:19pm UTC](https://forum.ansible.com/t/ansible-2-2-multi-sysctl-entry-addition-issue/27779 "2018-06-12T14:19:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Colin\_Phillips](https://avatars.discourse-cdn.com/v4/letter/c/8e7dd6/32.png) [@Colin\_Phillips](https://forum.ansible.com/u/Colin_Phillips)\
**Post date:** [June 12, 2018, 2:19pm UTC](https://forum.ansible.com/t/ansible-2-2-multi-sysctl-entry-addition-issue/27779/1 "2018-06-12T14:19:38Z")

</div>

Hi,

I’m trying to add the following to /etc/sysctl.conf

```auto
vm.dirty_ratio=10

```

```auto
vm.dirty_background_ratio=5

```

```auto

```

```auto
I am using the following code:

```

```auto

- sysctl:
  with_items:
    - { name: vm.dirty_ratio, value: 10, state: present }
    - { name: vm.dirty_background_ratio, value: 5, state: present }
  tags: sysctl

That isn't working correctly!

```

```auto

```

```auto
Any ideas on what I am missing?

Thanks

```

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [June 12, 2018, 5:20pm UTC](https://forum.ansible.com/t/ansible-2-2-multi-sysctl-entry-addition-issue/27779/2 "2018-06-12T17:20:00Z")

</div>

with\_items is a property to the task and not module.  
with\_items run the task as many times as there are elements.  
For each run you have the content of the element in a varialble called item, so in your case you have item.name, item.value and item.present.

You need to provide these values to the sysctl module so it now what it should configure.

&nbsp;&nbsp;&nbsp;name: '{{ item.name }}'  
&nbsp;&nbsp;&nbsp;value: '{{ item.value }}'

state is default present so you can leave that out or add it if you like.
