On 26.02.2019 22:57, John Harmon wrote:
> Consider the following:
> - name: Change sshd_config settings
>    lineinfile:
>      path: /etc/ssh/sshd_config
>      regexp: "{{ item.regexp }}"
>      line: "{{ item.line }}"
>    with_items:
>      - {regexp: "^#.*ClientAliveInterval.*$", line: "ClientAliveInterval
> 1800"}
>      - {regexp: "^#.*ClientAliveCountMax.*$", line: "ClientAliveCountMax 0"}
>    notify:
>      - restart ssh

Your regexps is checking for a line starting with hash #, but you don't have a 
line starting with # and contain ClientAliveInterval and ClientAliveCountMax.

And when you add a line that is also without # in the start of the line.

Remove your # in regexp.


-- 
Kai Stian Olstad

-- 
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/2d000447-c072-a92c-2830-5f329baab1a5%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to