On Wednesday, February 27, 2019 at 8:22:43 AM UTC-7, Kai Stian Olstad wrote:
>
> 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 
>

But the original did have a #.  I am showing you the results after running 
it a few times. 

-- 
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/b8a55faf-2695-4ad7-a572-2e32c20811a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to