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
>
I removed the hash as you said (leaving in the wild) and it is working
now. Thank you.
--
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/fab1391e-f3bd-4387-afa5-93e1b2ed524d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.