# Syntax issue... I think.

**URL:** <https://forum.ansible.com/t/syntax-issue-i-think/25478>\
**Category:** Ansible Project\
**Created:** [September 13, 2017, 10:42pm UTC](https://forum.ansible.com/t/syntax-issue-i-think/25478 "2017-09-13T22:42:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Harmon](https://avatars.discourse-cdn.com/v4/letter/j/edb3f5/32.png) [@John\_Harmon](https://forum.ansible.com/u/John_Harmon)\
**Post date:** [September 13, 2017, 10:42pm UTC](https://forum.ansible.com/t/syntax-issue-i-think/25478/1 "2017-09-13T22:42:18Z")

</div>

I have the following in my playbook. (As a side note, I am unsure of my syntax under “with\_items”. I have tried multiple variations, but I always get the same error. I just need another set of eyes to point out my problem):

`  
43 - name: Set tuning parameters in sysctl.conf  
44 lineinfile:  
45 path: /etc/sysctl.conf  
46 state: present  
47 line: “{{item.replace\_with}}”  
48 regexp: “{{item.regex}}”  
49 with\_items:  
50 - { replace\_with: ‘net.core.netdev\_max\_backlog = {{backlog\_value}}’,  
51 regexp: ‘^net._netdev\_max\_backlog._’ }  
52 - { replace\_with: ‘net.core.rmem\_max = {{bdp|int}}’,  
53 regexp: ‘^net._core.rmem\_max.’ }  
54 - { replace\_with: ‘net.core.wmem\_max = {{bdp|int}}’,  
55 regexp: ‘^net.core.wmem\_max.’ }  
56 - { replace\_with: ‘net.ipv4.tcp\_moderate\_rcvbuf = 1’,  
57 regexp: '^net.ipv4.tcp\_moderate\_rcvbuf.’ }  
58 - { replace\_with: ‘net.ipv4.tcp\_rmem = 4096 87380 {{bdp|int}}’,  
59 regexp: '^net.ipv4.tcp\_rmem._’ }  
60 - { replace\_with: ‘net.ipv4.tcp\_wmem = 4096 87380 {{bdp|int}}’,  
61 regexp: ‘^net.ipv4.tcp\_wmem.\*’ }  
62 #notify: sysctl\_trigger

`

I get the following error. You can see from the output that “bdp|int” is populated, as is “backlog\_value”. I don’t know what it is bombing on.

`  
TASK [hugepages : Debug 2] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [ansibletest-oel6] =\> {  
“bdp|int”: “1603750000”  
}

TASK [hugepages : Debug 3] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [ansibletest-oel6] =\> {  
“backlog\_value”: “300000”  
}

TASK [hugepages : Set tuning parameters in sysctl.conf] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
fatal: [ansibletest-oel6]: FAILED! =\> {“failed”: true, “msg”: “the field ‘args’ has an invalid value, which appears to include a variable that is undefined. The error was: ‘dict object’ has no attribute ‘regex’\n\nThe error appears to have been in ‘/etc/ansible/roles/hugepages/tasks/main.yml’: line 43, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Set tuning parameters in sysctl.conf\n ^ here\n”}

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ansibletest-oel6 : ok=8 changed=0 unreachable=0 failed=1

`

---

<div class="post-metadata">

**Author:** ![John\_Harmon](https://avatars.discourse-cdn.com/v4/letter/j/edb3f5/32.png) [@John\_Harmon](https://forum.ansible.com/u/John_Harmon)\
**Post date:** [September 13, 2017, 10:56pm UTC](https://forum.ansible.com/t/syntax-issue-i-think/25478/2 "2017-09-13T22:56:01Z")

</div>

I found my problem. I put regex instead of regexp on line 48… It was a syntax issue
