Using win_lineinfile module to search a keyword from, but string is inserted in file

  ansible, powershell, windows

when i execute this is my playbook. its not searching the keyword ,but adding the keyword in the file.Whats the exact issue?

---
- hosts: win

  tasks:
    - name: "find text"
      win_lineinfile:
        path: C:temptest.txt
        line: " ansible"
        state: present
        check mode: yes

Source: Windows Questions

LEAVE A COMMENT