feat(infra): 1n-alt
[csit.git] / fdio.infra.ansible / roles / vpp_device / tasks / main.yaml
1 ---
2 # file: tasks/main.yaml
3
4 - name: "Load Kernel Modules On Startup (vfio-pci)"
5   ansible.builtin.lineinfile:
6     path: "/etc/modules"
7     state: "present"
8     line: "{{ item }}"
9   with_items:
10     - "vfio-pci"
11   tags:
12     - load-kernel-modules
13
14 - name: "Disable IPv6 Router Advertisement"
15   ansible.builtin.sysctl:
16     name: "net.ipv6.conf.default.accept_ra"
17     value: "0"
18     state: "present"
19     sysctl_file: "/etc/sysctl.d/90-csit.conf"
20     reload: "yes"
21   tags:
22     - set-sysctl
23
24 - name: "Disable IPv6 Router Advertisement"
25   ansible.builtin.sysctl:
26     name: "net.ipv6.conf.all.accept_ra"
27     value: "0"
28     state: "present"
29     sysctl_file: "/etc/sysctl.d/90-csit.conf"
30     reload: "yes"
31   tags:
32     - set-sysctl
33
34 - name: "Disable IPv6 MLDv1 interval"
35   ansible.builtin.sysctl:
36     name: "net.ipv6.conf.all.mldv1_unsolicited_report_interval"
37     value: "0"
38     state: "present"
39     sysctl_file: "/etc/sysctl.d/90-csit.conf"
40     reload: "yes"
41   tags:
42     - set-sysctl
43
44 - name: "Disable IPv6 MLDv2 interval"
45   ansible.builtin.sysctl:
46     name: "net.ipv6.conf.all.mldv2_unsolicited_report_interval"
47     value: "0"
48     state: "present"
49     sysctl_file: "/etc/sysctl.d/90-csit.conf"
50     reload: "yes"
51   tags:
52     - set-sysctl
53
54 - name: "Disable IPv6 Autoconf"
55   ansible.builtin.sysctl:
56     name: "net.ipv6.conf.all.autoconf"
57     value: "0"
58     state: "present"
59     sysctl_file: "/etc/sysctl.d/90-csit.conf"
60     reload: "yes"
61   tags:
62     - set-sysctl
63
64 - name: "Disable IPv6 MC Forwarding"
65   ansible.builtin.sysctl:
66     name: "net.ipv6.conf.all.mc_forwarding"
67     value: "0"
68     state: "present"
69     sysctl_file: "/etc/sysctl.d/90-csit.conf"
70     reload: "yes"
71   tags:
72     - set-sysctl
73
74 - name: "Copy csit-initialize-vfs.sh"
75   ansible.builtin.copy:
76     src: "files/csit-initialize-vfs.sh"
77     dest: "/usr/local/bin/"
78     owner: "root"
79     group: "root"
80     mode: 0744
81   tags:
82     - copy-vf-script
83
84 - name: "Copy csit-initialize-vfs-data.sh"
85   ansible.builtin.copy:
86     src: "files/{{ vfs_data_file }}"
87     dest: "/usr/local/bin/csit-initialize-vfs-data.sh"
88     owner: "root"
89     group: "root"
90     mode: 0744
91   tags: copy-vf-data-script
92   when:
93     - vfs_data_file is defined
94
95 - name: "Copy Default csit-initialize-vfs-data.sh"
96   ansible.builtin.copy:
97     src: "files/csit-initialize-vfs-default.sh"
98     dest: "/usr/local/bin/csit-initialize-vfs-data.sh"
99     owner: "root"
100     group: "root"
101     mode: 0744
102   tags: copy-vf-data-script
103   when:
104     - vfs_data_file is not defined
105
106 - name: "Start csit-initialize-vfs.service"
107   ansible.builtin.copy:
108     src: "files/csit-initialize-vfs.service"
109     dest: "/etc/systemd/system/"
110     owner: "root"
111     group: "root"
112     mode: 0644
113   notify:
114     - "Start csit-initialize-vfs.service"
115   tags:
116     - start-vf-service
117
118 - ansible.builtin.meta: "flush_handlers"
119
120 - name: "Set Hugepages In GRUB"
121   ansible.builtin.lineinfile:
122     path: "/etc/default/grub"
123     state: "present"
124     regexp: "^GRUB_CMDLINE_LINUX="
125     line: "GRUB_CMDLINE_LINUX=\"{% for key, value in grub.items() %}{% if value %}{{key}}={{value}} {% else %}{{key}} {% endif %}{% endfor %}\""
126   notify:
127     - "Update GRUB"
128   tags:
129     - set-grub