Merge "Fix Ssh connection issues on openstack-ansible-ops mnaio builds"

This commit is contained in:
Zuul 2018-03-14 05:42:36 +00:00 committed by Gerrit Code Review
commit 2cb67be496
2 changed files with 46 additions and 0 deletions

View File

@ -177,6 +177,47 @@
- deploy-vms
- name: Set MaxSessions and MaxStartups to reduce connection failures
hosts: vm_servers
gather_facts: "{{ gather_facts | default(true) }}"
pre_tasks:
- name: Gather variables for each operating system
include_vars: "{{ item }}"
with_first_found:
- "{{ playbook_dir }}/vars/{{ ansible_distribution | lower }}-{{ ansible_distribution_version | lower }}.yml"
- "{{ playbook_dir }}/vars/{{ ansible_distribution | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
- "{{ playbook_dir }}/vars/{{ ansible_os_family | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
- "{{ playbook_dir }}/vars/{{ ansible_distribution | lower }}.yml"
- "{{ playbook_dir }}/vars/{{ ansible_os_family | lower }}.yml"
tags:
- always
tasks:
- lineinfile:
path: /etc/ssh/sshd_config
line: MaxStartups 100
state: present
regexp: '^MaxStartups.*$'
notify:
- restart sshd
- lineinfile:
path: /etc/ssh/sshd_config
line: MaxSessions 100
state: present
regexp: '^MaxSessions.*$'
notify:
- restart sshd
handlers:
- name: restart sshd
service:
name: "{{ ssh_service_name }}"
state: restarted
environment: "{{ deployment_environment_variables | default({}) }}"
tags:
- deploy-vms
- name: Setup cinder host volume
hosts: cinder_hosts:swift_hosts
gather_facts: false
@ -276,3 +317,5 @@
tags:
- deploy-vms

View File

@ -43,3 +43,6 @@ mnaio_pkg_cache_server_distro_packages:
- apt-cacher-ng
mnaio_host_iptables_service: "{{ (ansible_distribution | lower + '-' + ansible_distribution_version | lower == 'ubuntu-14.04') | ternary('iptables-persistent', 'netfilter-persistent') }}"
ssh_service_name: ssh