I'm working with Ansible and I've encountered a syntax error that I can't seem to resolve. The error message indicates that it did not find the expected '-' indicator. Here's a sanitized version of the code block where the error occurs:
- name: Add lines to "file.conf" if they do not exist
lineinfile:
path: /path/to/file.conf
insertafter: '^# Comment'
line: "{{ item }}"
with_items:
- "/path/to/command1 p+i+n+u+g+s+b+acl+xattrs+sha512"
- "/path/to/command2 p+i+n+u+g+s+b+acl+xattrs+sha512"
when: result.rc != 0
ignore_errors: true
failed_when: false
The error points to the line starting with '- name'. Any insights on what might be causing this issue?
The service I’m trying to disable is a placeholder. Any ideas on how to troubleshoot this?