123456789101112131415161718192021222324252627 |
- ---
- - name: Modify sshd_config for session timeout
- ansible.builtin.lineinfile:
- path: "{{ sshd_conf_file }}"
- regexp: "{{ item.regexp }}"
- line: "{{ item.line }}"
- register: session_timeout
- notify:
- - Restart sshd
- with_items:
- - { regexp: "^.*ClientAliveInterval*", line: "ClientAliveInterval {{ session_timeout }}" }
- - { regexp: "^.*ClientAliveCountMax*", line: "ClientAliveCountMax 0" }
|