This fails to find any lines (which exist) in my files.  Basically, I want 
to find any line that isn't a comment, that matches the expression and 
delete it.  Any ideas?

- name: Remove tuning parameters from /etc/security/limits.conf if present
  lineinfile:
    path: /etc/security/limits.conf
    regexp: "{{ item.regexp }}"
    state: absent
  with_items:
    - { regexp: "^(?!#).*soft.*nofile.*" }
    - { regexp: "^(?!#).*hard.*nofile.*" }
    - { regexp: "^(?!#).*soft.*nproc.*" }
    - { regexp: "^(?!#).*hard.*nproc.*" }
    - { regexp: "^(?!#).*soft.*stack.*" }
    - { regexp: "^(?!#).*hard.*stack.*" }
    - { regexp: "^(?!#).*soft.*memlock.*" }
    - { regexp: "^(?!#).*hard.*memlock.*" }


-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/adbb15cc-a360-4b2c-97b0-3de60e0c056b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to