ansible/base: Add network tasks, set congestion control options
[noc.git] / ansible / roles / base / tasks / 06net.yml
1 ---
2 - name: Configure to load network-related kernel modules
3   copy:
4     dest: /etc/modules-load.d/local-network.conf
5     content: '{{ network_modules | join("\n") }}'
6
7 - name: Load network-related kernel modules
8   modprobe:
9     name: "{{ item }}"
10   with_items: "{{ network_modules }}"
11     
12 - name: Set network-related sysctl options
13   sysctl:
14     sysctl_file: /etc/sysctl.d/local-network.conf
15     sysctl_set: yes
16     name: "{{ item.key }}"
17     value: "{{ item.value }}"
18
19   with_dict:
20     # CoDel (controlled delay) with Fair Queuing as the default queue scheduler
21     #  mitigates bufferbloat and helps share bandwidth equitably across flows.
22     net.core.default_qdisc: fq_codel
23
24     # BBR is currently the best TCP congestion control algorithm.
25     # C.f. https://queue.acm.org/detail.cfm?id=3022184
26     net.ipv4.tcp_congestion_control: bbr
27
28   loop_control:
29     label: "{{ item.key }}"