ulimits.yml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. - name: Setup nofile for system
  2. become: true
  3. ansible.builtin.lineinfile:
  4. path: /etc/systemd/system.conf
  5. regexp: "^DefaultLimitNOFILE="
  6. line: DefaultLimitNOFILE=2097152
  7. backup: true
  8. - name: Setup nproc for system
  9. become: true
  10. ansible.builtin.lineinfile:
  11. path: /etc/systemd/system.conf
  12. regexp: "^DefaultLimitNPROC"
  13. line: DefaultLimitNPROC=524288
  14. backup: true
  15. - name: Setup nofile for user
  16. become: true
  17. ansible.builtin.lineinfile:
  18. path: /etc/systemd/user.conf
  19. regexp: "^DefaultLimitNOFILE="
  20. line: DefaultLimitNOFILE=1048576
  21. backup: true
  22. - name: Setup nproc for user
  23. become: true
  24. ansible.builtin.lineinfile:
  25. path: /etc/systemd/user.conf
  26. regexp: "^DefaultLimitNPROC"
  27. line: DefaultLimitNPROC=262144
  28. backup: true
  29. - name: Set user level open file limits for root
  30. become: true
  31. ansible.builtin.lineinfile:
  32. path: /etc/security/limits.conf
  33. line: root soft nofile 10240
  34. backup: true
  35. - name: Set user level open file limits for {{ ansible_user }}
  36. become: true
  37. ansible.builtin.lineinfile:
  38. path: /etc/security/limits.conf
  39. line: "{{ ansible_user }} soft nofile 10240"
  40. backup: true
  41. # https://docs.oracle.com/en/database/oracle/oracle-database/12.2/ladbi/changing-kernel-parameter-values.html#GUID-FB0CC366-61C9-4AA2-9BE7-233EB6810A31
  42. - name: Setup file max
  43. become: true
  44. ansible.builtin.lineinfile:
  45. path: "/etc/sysctl.d/100-palm.conf"
  46. state: present
  47. line: "fs.file-max = 6815744"
  48. create: true
  49. - name: Setup file max
  50. become: true
  51. ansible.builtin.lineinfile:
  52. path: "/etc/sysctl.d/100-palm.conf"
  53. state: present
  54. line: "fs.inotify.max_user_watches = 512000"
  55. create: true
  56. - name: Setup vm max map count
  57. become: true
  58. ansible.builtin.lineinfile:
  59. path: "/etc/sysctl.d/100-palm.conf"
  60. state: present
  61. line: "vm.max_map_count = 262144"
  62. create: true
  63. - name: Setup vm over commit memory
  64. become: true
  65. ansible.builtin.lineinfile:
  66. path: "/etc/sysctl.d/100-palm.conf"
  67. state: present
  68. line: "vm.overcommit_memory = 1"
  69. create: true