-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadd_kernel_modules.yml
61 lines (58 loc) · 1.74 KB
/
add_kernel_modules.yml
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
53
54
55
56
57
58
59
---
- name: Load RKE kernel modules, 5th
# per https://rancher.com/docs/rke/latest/en/os/
# To check prior to running playbook:
#
# for module in br_netfilter ip6_udp_tunnel ip_set ip_set_hash_ip ip_set_hash_net iptable_filter iptable_nat iptable_mangle iptable_raw nf_conntrack_netlink nf_conntrack nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat nf_nat_ipv4 nf_nat_masquerade_ipv4 nfnetlink udp_tunnel veth vxlan x_tables xt_addrtype xt_conntrack xt_comment xt_mark xt_multiport xt_nat xt_recent xt_set xt_statistic xt_tcpudp;
# do
# if ! lsmod | grep -q $module; then
# echo "module $module is not present";
# fi;
# done
hosts: ubuntu-rke
#remote_user: ubuntu
vars:
kernel_modules:
- br_netfilter
- ip6_udp_tunnel
- ip_set
- ip_set_hash_ip
- ip_set_hash_net
- iptable_filter
- iptable_nat
- iptable_mangle
- iptable_raw
- nf_conntrack_netlink
- nf_conntrack
- nf_conntrack_ipv4
- nf_defrag_ipv4
- nf_nat
- nf_nat_ipv4
- nf_nat_masquerade_ipv4
- nfnetlink
- udp_tunnel
- veth
- vxlan
- x_tables
- xt_addrtype
- xt_conntrack
- xt_comment
- xt_mark
- xt_multiport
- xt_nat
- xt_recent
- xt_set
- xt_statistic
- xt_tcpudp
tasks:
- name: Load kernel modules for RKE, which get removed at node reboot
modprobe:
name: "{{ item }}"
state: present
with_items: "{{ kernel_modules }}"
- name: Set kernel modules for RKE to be loaded at boot time, in /etc/modules
lineinfile:
path: /etc/modules
line: "{{ item }}"
state: present
with_items: "{{ kernel_modules }}"