Maybe you can try to proceed by inclusion, knowing the format of a
limits.conf :
^\s*[*a-z]+\s+soft\s+nofile

R.

Le lun. 6 nov. 2017 à 23:54, John Harmon <[email protected]> a
écrit :

> 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
> <https://groups.google.com/d/msgid/ansible-project/adbb15cc-a360-4b2c-97b0-3de60e0c056b%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CADjH%3DhQ51L6EN46yAb1p8kSpASvv_8EcGS_2JmgnFfPPxkVJaw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to