commit a6476c3f5b6b4707c3a177cd1ed68ef6f804de51 Author: Dmitriy Rabotyagov Date: Thu Oct 15 11:25:36 2020 +0300 Increase amount of MaxSessions For running bigger amount of ansible forks, we need to increase ssh MaxSessions parameter for lxc hosts, since all connections to lxc containers occur through hosts Depends-On: https://review.opendev.org/758399 Change-Id: Ib3e850ba79658a42995cd782a11342aca6858342 diff --git a/handlers/main.yml b/handlers/main.yml index 8d365f5..a51c357 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -93,6 +93,12 @@ name: it_does_not_matter daemon_reload: yes +- name: Restart sshd + service: + name: sshd + state: "restarted" + enabled: yes + - name: Remove rootfs archive file: path: "/tmp/{{ cache_basename }}" diff --git a/tasks/lxc_post_install.yml b/tasks/lxc_post_install.yml index f8eee2d..3447924 100644 --- a/tasks/lxc_post_install.yml +++ b/tasks/lxc_post_install.yml @@ -63,6 +63,17 @@ tags: - lxc-config +- name: Set sshd MaxSessions + lineinfile: + dest: /etc/ssh/sshd_config + state: present + regexp: "^#?MaxSessions.*$" + line: "MaxSessions 50" + notify: + - Restart sshd + tags: + - lxc-config + # NOTE(hwoarang): The previous task only affected newly created services. # However, for particular systemd versions like v228 the default one for # started scopes is 512