# \<replace\> not working \<with\_items\> anymore.

**URL:** <https://forum.ansible.com/t/replace-not-working-with-items-anymore/31245>\
**Category:** Ansible Project\
**Created:** [September 9, 2019, 7:19pm UTC](https://forum.ansible.com/t/replace-not-working-with-items-anymore/31245 "2019-09-09T19:19:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jean\_Roux](https://avatars.discourse-cdn.com/v4/letter/j/df788c/32.png) [@Jean\_Roux](https://forum.ansible.com/u/Jean_Roux)\
**Post date:** [September 9, 2019, 7:19pm UTC](https://forum.ansible.com/t/replace-not-working-with-items-anymore/31245/1 "2019-09-09T19:19:00Z")

</div>

Hi, have not been working with Ansible for a yr+, one of my playbooks not working anymore:

- name: Edit node-RED config.js  
replace:  
path: “{{folder.apps}}/{{ iotp\_app }}/data/settings.js”  
regexp: “{{ item.regexp }}”  
replace: “{{ item.replace }}”  
backup: yes  
owner: “{{user\_details.nodered.usr}}”  
group: “{{[user\_details.nodered.gp](http://user_details.nodered.gp/)}}”  
with\_items:
- { regexp: ‘//credentialSecret: “a-secret-key”,’, replace: ‘credentialSecret: “{{ credentialSecret }}”,’ }
- { regexp: “//httpAdminRoot: ‘/admin’,”, replace: “httpAdminRoot: ‘/admin’,”}
- { regexp: “enabled: false”, replace: “enabled: true”}  
tags:
- lines

Enter code here…

I also replaced **with\_items** , still not working.

Getting following error:

`

ERROR! ‘loop’ is not a valid attribute for a Play

`

Same with **with\_items** -

Now on:

- ansible 2.8.4
- python version = 2.7.14

Any ideas?
