summaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-increase-limits.yml
blob: 1a78e832f5083e3e36a373688243db33b13155fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
---
#- hosts: [database, config, control, collector]
#  sudo: yes
#  tasks:
- name: "delete line"
#  sudo: True
  lineinfile:
    dest: "/etc/limits.conf"
    regexp: "^root\\s*soft\\s*nproc\\s*.*"
    state: "absent"

- name: "check EOF"
#  sudo: True
  lineinfile:
    dest: "/etc/security/limits.conf"
    regexp: "^# End of file"
    line: "# End of file"

- name: "add lines"
#  sudo: True
  lineinfile:
    dest: "/etc/security/limits.conf"
    regexp: "{{ item.regexp }}"
    line: "{{ item.line }}"
    insertbefore: "^# End of file"
  with_items:
    - { regexp: "^root\\s*hard\\s*nofile\\s*.*", line: "root hard nofile 65535" }
    - { regexp: "^root\\s*soft\\s*nofile\\s*.*", line: "root soft nofile 65535" }
    - { regexp: "^\\*\\s*hard\\s*nofile\\s*.*", line: "* hard nofile 65535" }
    - { regexp: "^\\*\\s*soft\\s*nofile\\s*.*", line: "* soft nofile 65535" }
    - { regexp: "^\\*\\s*hard\\s*nproc\\s*.*", line: "* hard nproc 65535" }
    - { regexp: "^\\*\\s*soft\\s*nproc\\s*.*", line: "* soft nproc 65535" }

- name: change value of sysctl fs.file-max
#  sudo: True
  sysctl:
    name: "fs.file-max"
    value: "65535"

- name: "find supervisord conf files"
#  sudo: True
  shell: "find /etc/contrail -name supervisor*.conf -type f"
  register: supervisordconfs
  changed_when: no

- name: "modify supervisord conf"
#  sudo: True
  replace:
    dest: "{{ item }}"
    regexp: "^minfds=\\d*"
    replace: "minfds=10240"
  with_items: supervisordconfs.stdout_lines