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
This commit is contained in:
Dmitriy Rabotyagov 2020-10-15 11:25:36 +03:00 committed by Jonathan Rosser
parent b6685491e9
commit a6476c3f5b
2 changed files with 17 additions and 0 deletions

View File

@ -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 }}"

View File

@ -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