issue with line insert lininfile

I keep getting errors when running an insert line task

the task to insert is

  • name: add line
    lineinfile:
    backup: no
    backrefs: yes
    state: present
    path: “{{ file_path }}”
    regexp: ‘^(\s*)[#]?{{ item.search }}(: )*’
    line: ‘\1{{ item.search }}\2\n\1{{ item.add }}’
    with_items:
  • { search: “{{ line.replace_with }}”, add: “{{ line.line_to_add }}” }
  • name: add line
    lineinfile:
    backup: no
    state: present
    path: “{{ file_path }}”
    regexp: ‘^(\s*)[#]?{{ item.search.replace(“/”, “\/”) }}(: )*’
    line: ‘\1{{ item.search }}\2\n\1{{ item.add }}’
    with_items:
  • { search: “{{ line.replace_with }}”, add: “{{ line.line_to_add }}” }