add disable ipv6
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
vincent 2022-02-13 09:01:05 +01:00
parent 15bd836197
commit a7b16cb3bc
5 changed files with 17 additions and 1 deletions

View File

@ -117,3 +117,5 @@ hosts_entries: []
# Custom host file snippets to be added # Custom host file snippets to be added
hosts_file_snippets: [] hosts_file_snippets: []
system_ipV6_disable: true

View File

@ -12,3 +12,6 @@
- name: Restart sshd - name: Restart sshd
service: name=sshd state=restarted service: name=sshd state=restarted
become: yes become: yes
- name: restart_sysctl
service: name=systemd-sysctl state=restarted

View File

@ -1,6 +1,6 @@
---
#- include_tasks: hostname.yml #- include_tasks: hostname.yml
- include_tasks: hosts.yml - include_tasks: hosts.yml
- include_tasks: tasks.sysctl.yml
- include_tasks: dhcpcd.yml - include_tasks: dhcpcd.yml
- include_tasks: hostname.yml - include_tasks: hostname.yml
- include_tasks: locales.yml - include_tasks: locales.yml

10
tasks/tasks.sysctl.yml Normal file
View File

@ -0,0 +1,10 @@
---
- name: disable IPV6
template:
src: 40-ipv6.j2
dest: /etc/sysctl.d/40-ipv6.conf
owner: root
group: root
mode: 0644
notify: restart_sysctl
become: True

1
templates/40-ipv6.j2 Normal file
View File

@ -0,0 +1 @@
net.ipv6.conf.all.disable_ipv6 = {% if system_ipV6_disable %} 1 {% else %} 0 {% endif %}