|
1 | | -- name: tuned - Install and configure tuned |
| 1 | +- name: 'tuned - Install and configure tuned' # noqa: name[casing] |
2 | 2 | when: |
3 | 3 | - (stage2_nix or nixpkg_mode or debpkg_mode) |
4 | 4 | block: |
5 | | - - name: tuned - Install tuned |
| 5 | + - name: 'tuned - Install tuned' # noqa: name[casing] |
6 | 6 | ansible.builtin.apt: |
7 | 7 | force_apt_get: true |
8 | 8 | name: 'tuned' |
|
11 | 11 | update_cache: true |
12 | 12 | become: true |
13 | 13 |
|
14 | | - - name: tuned - Create a tuned profile directory |
| 14 | + - name: 'tuned - Create a tuned profile directory' # noqa: name[casing] |
15 | 15 | ansible.builtin.file: |
16 | 16 | group: 'root' |
17 | 17 | mode: '0755' |
|
20 | 20 | state: 'directory' |
21 | 21 | become: true |
22 | 22 |
|
23 | | - - name: tuned - Create a profile symlink for older tuned versions |
| 23 | + - name: 'tuned - Create a profile symlink for older tuned versions' # noqa: name[casing] |
24 | 24 | ansible.builtin.file: |
25 | 25 | force: true |
26 | 26 | group: 'root' |
|
31 | 31 | state: 'link' |
32 | 32 | become: true |
33 | 33 |
|
34 | | - - name: tuned - Create a tuned profile |
35 | | - ansible.builtin.ini_file: |
| 34 | + - name: 'tuned - Create a tuned profile' # noqa: name[casing] |
| 35 | + community.general.ini_file: |
36 | 36 | create: true |
37 | 37 | group: 'root' |
38 | 38 | mode: '0644' |
|
44 | 44 | value: 'Tuned profile for PostgreSQL' |
45 | 45 | become: true |
46 | 46 |
|
47 | | - - name: tuned - Disable Transparent Huge Pages (THP) |
48 | | - ansible.builtin.ini_file: |
| 47 | + - name: 'tuned - Disable Transparent Huge Pages (THP)' # noqa: name[casing] |
| 48 | + community.general.ini_file: |
49 | 49 | create: true |
50 | 50 | group: 'root' |
51 | 51 | mode: '0644' |
|
57 | 57 | value: 'never' |
58 | 58 | become: true |
59 | 59 |
|
60 | | - - name: tuned - Configure performance |
61 | | - ansible.builtin.ini_file: |
| 60 | + - name: 'tuned - Configure performance' # noqa: name[casing] |
| 61 | + community.general.ini_file: |
62 | 62 | create: true |
63 | 63 | group: 'root' |
64 | 64 | mode: '0644' |
65 | 65 | no_extra_spaces: true |
66 | | - option: "{{ perf_item['option'] }}" |
| 66 | + option: 'governor' |
67 | 67 | path: '/etc/tuned/profiles/postgresql/tuned.conf' |
68 | | - section: "{{ perf_item['section'] }}" |
| 68 | + section: 'cpu' |
69 | 69 | state: 'present' |
70 | | - value: "{{ perf_item['value'] }}" |
| 70 | + value: 'performance' |
71 | 71 | become: true |
72 | | - loop: |
73 | | - - { option: 'governor', section: 'cpu', value: 'performance' } |
74 | | - loop_control: |
75 | | - loop_var: 'perf_item' |
76 | 72 |
|
77 | | - - name: tuned - Configure Intel CPUs for maximum performance |
78 | | - ansible.builtin.ini_file: |
| 73 | + - name: 'tuned - Configure Intel CPUs for maximum performance' # noqa: name[casing] |
| 74 | + community.general.ini_file: |
79 | 75 | create: true |
80 | 76 | group: 'root' |
81 | 77 | mode: '0644' |
|
87 | 83 | value: "{{ intel_item['value'] }}" |
88 | 84 | become: true |
89 | 85 | loop: |
90 | | - - { option: 'energy_perf_bias', section: 'cpu', value: 'performance' } |
91 | | - - { option: 'min_perf_pct', section: 'cpu', value: '100' } |
| 86 | + - option: 'energy_perf_bias' |
| 87 | + section: 'cpu' |
| 88 | + value: 'performance' |
| 89 | + - option: 'min_perf_pct' |
| 90 | + section: 'cpu' |
| 91 | + value: '100' |
92 | 92 | loop_control: |
93 | 93 | loop_var: 'intel_item' |
94 | 94 | when: |
95 | 95 | - ansible_facts['processor'][0] is search('GenuineIntel', ignorecase=True) |
96 | 96 |
|
97 | | - - name: tuned - Set sysctl parameters |
98 | | - ansible.builtin.ini_file: |
| 97 | + - name: 'tuned - Set sysctl parameters' # noqa: name[casing] |
| 98 | + community.general.ini_file: |
99 | 99 | create: true |
100 | 100 | group: 'root' |
101 | 101 | mode: '0644' |
|
107 | 107 | value: "{{ sysctl_item['value'] }}" |
108 | 108 | become: true |
109 | 109 | loop: |
110 | | - - { option: 'net.ipv4.tcp_keepalive_intvl', value: '60' } |
111 | | - - { option: 'net.ipv4.tcp_keepalive_time', value: '1800' } |
112 | | - - { option: 'net.ipv4.ip_local_reserved_ports', value: '3000,3001,8085,9122,9187,9999' } |
113 | | - - { option: 'net.ipv4.ip_local_port_range', value: '1025 65000' } |
114 | | - - { option: 'vm.panic_on_oom', value: '1' } |
115 | | - - { option: 'net.core.somaxconn', value: '16834' } |
| 110 | + - option: 'fs.aio-max-nr' |
| 111 | + value: '1048576' |
| 112 | + - option: 'fs.file-max' |
| 113 | + value: '312139770' |
| 114 | + - option: 'net.core.somaxconn' |
| 115 | + value: '16834' |
| 116 | + - option: 'net.ipv4.ip_local_port_range' |
| 117 | + value: '1025 65000' |
| 118 | + - option: 'net.ipv4.ip_local_reserved_ports' |
| 119 | + value: '3000,3001,8085,9122,9187,9999' |
| 120 | + - option: 'net.ipv4.tcp_keepalive_intvl' |
| 121 | + value: '60' |
| 122 | + - option: 'net.ipv4.tcp_keepalive_time' |
| 123 | + value: '1800' |
| 124 | + - option: 'vm.panic_on_oom' |
| 125 | + value: '1' |
116 | 126 | loop_control: |
117 | 127 | loop_var: 'sysctl_item' |
118 | 128 |
|
119 | | - - name: tuned - Set kernel.panic=10 |
120 | | - ansible.builtin.ini_file: |
| 129 | + - name: 'tuned - Set kernel.panic=10' # noqa: name[casing] |
| 130 | + community.general.ini_file: |
121 | 131 | create: true |
122 | 132 | group: 'root' |
123 | 133 | mode: '0644' |
|
131 | 141 | when: |
132 | 142 | - (debpkg_mode or nixpkg_mode) |
133 | 143 |
|
134 | | - - name: tuned - Enable zswap if swap is present |
| 144 | + - name: 'tuned - Enable zswap if swap is present' # noqa: name[casing] |
135 | 145 | when: |
136 | 146 | - ansible_facts['swaptotal_mb'] > 0 |
137 | 147 | block: |
138 | | - - name: tuned - Decrease the kernel swappiness |
139 | | - ansible.builtin.ini_file: |
| 148 | + - name: 'tuned - Decrease the kernel swappiness' # noqa: name[casing] |
| 149 | + community.general.ini_file: |
140 | 150 | create: true |
141 | 151 | group: 'root' |
142 | 152 | mode: '0644' |
|
148 | 158 | value: '10' |
149 | 159 | become: true |
150 | 160 |
|
151 | | - - name: tuned - Load zstd compressor module |
| 161 | + - name: 'tuned - Load zstd compressor module' # noqa: name[casing] |
152 | 162 | community.general.modprobe: |
153 | 163 | name: 'zstd' |
154 | 164 | persistent: 'present' |
155 | 165 | state: 'present' |
156 | 166 | become: true |
157 | 167 |
|
158 | | - - name: tuned - Configure and enable zswap |
| 168 | + - name: 'tuned - Configure and enable zswap' # noqa: name[casing] |
159 | 169 | ansible.builtin.shell: |
160 | 170 | cmd: "echo {{ zswap_item['value'] }} > /sys/module/zswap/parameters/{{ zswap_item['param'] }}" |
| 171 | + changed_when: true |
161 | 172 | loop: |
162 | | - - { param: 'compressor', value: 'zstd' } |
163 | | - - { param: 'max_pool_percent', value: '10' } |
164 | | - - { param: 'zpool', value: 'zsmalloc' } |
165 | | - - { param: 'enabled', value: 'Y' } |
| 173 | + - param: 'compressor' |
| 174 | + value: 'zstd' |
| 175 | + - param: 'max_pool_percent' |
| 176 | + value: '10' |
| 177 | + - param: 'zpool' |
| 178 | + value: 'zsmalloc' |
| 179 | + - param: 'enabled' |
| 180 | + value: 'Y' |
166 | 181 | loop_control: |
167 | 182 | loop_var: 'zswap_item' |
168 | 183 |
|
169 | | - - name: tuned - Activate the tuned service |
| 184 | + - name: 'tuned - Activate the tuned service' # noqa: name[casing] |
170 | 185 | ansible.builtin.systemd_service: |
171 | 186 | daemon_reload: true |
172 | 187 | enabled: true |
173 | 188 | name: 'tuned' |
174 | 189 | state: "{{ 'restarted' if stage2_nix else 'stopped' }}" |
175 | 190 | become: true |
176 | 191 |
|
177 | | - - name: tuned - Activate the PostgreSQL tuned profile |
| 192 | + - name: 'tuned - Activate the PostgreSQL tuned profile' # noqa: name[casing] |
178 | 193 | ansible.builtin.command: |
179 | 194 | cmd: 'tuned-adm profile postgresql' |
180 | 195 | become: true |
|
0 commit comments