<replace> not working <with_items> anymore.

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}}”
    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?