fix: instead of defining modules twice just restart the modules-load service

This commit is contained in:
Devin Buhl authored and GitHub committed 2023-12-11 15:14:17 -05:00
1 parent 65bfe7a992
commit bf28fbaebf
1 file changed
+4 -5
@@ -101,16 +101,15 @@
state: absent state: absent
loop: ["none", "swap"] loop: ["none", "swap"]
- name: System Configuration | Kernel modules (1) - name: System Configuration | Kernel modules (1)
community.general.modprobe:
name: "{% raw %}{{ item }}{% endraw %}"
state: present
loop: ["br_netfilter", "ceph", "ip_vs", "ip_vs_rr", "nbd", "overlay", "rbd"]
- name: System Configuration | Kernel modules (2)
ansible.builtin.copy: ansible.builtin.copy:
dest: "/etc/modules-load.d/{% raw %}{{ item }}{% endraw %}.conf" dest: "/etc/modules-load.d/{% raw %}{{ item }}{% endraw %}.conf"
mode: "0644" mode: "0644"
content: "{% raw %}{{ item }}{% endraw %}" content: "{% raw %}{{ item }}{% endraw %}"
loop: ["br_netfilter", "ceph", "ip_vs", "ip_vs_rr", "nbd", "overlay", "rbd"] loop: ["br_netfilter", "ceph", "ip_vs", "ip_vs_rr", "nbd", "overlay", "rbd"]
- name: System Configuration | Kernel modules (2)
ansible.builtin.systemd:
name: systemd-modules-load
state: restarted
- name: System Configuration | Sysctl - name: System Configuration | Sysctl
ansible.posix.sysctl: ansible.posix.sysctl:
name: "{% raw %}{{ item.key }}{% endraw %}" name: "{% raw %}{{ item.key }}{% endraw %}"