add disable ipv2
This commit is contained in:
parent
c83850bb09
commit
2cdfcb5ae7
37
disable-ipv6.yml
Normal file
37
disable-ipv6.yml
Normal file
@ -0,0 +1,37 @@
|
||||
---
|
||||
- name: disable IPv6 with sysctl
|
||||
sysctl: name={{ item }} value=1 state=present reload=yes
|
||||
with_items:
|
||||
- net.ipv6.conf.all.disable_ipv6
|
||||
- net.ipv6.conf.default.disable_ipv6
|
||||
- net.ipv6.conf.lo.disable_ipv6
|
||||
|
||||
#- name: placeholder true for ipv6 in modprobe
|
||||
# lineinfile:
|
||||
# dest: /etc/modprobe.conf
|
||||
# line: 'install ipv6 /bin/true'
|
||||
# mode: '0644'
|
||||
|
||||
- name: disable ipv6 in sysconfig/network
|
||||
lineinfile:
|
||||
dest: /etc/sysconfig/network
|
||||
regexp: "^{{ item.regexp }}"
|
||||
line: "{{ item.line }}"
|
||||
mode: '0644'
|
||||
backup: yes
|
||||
create: yes
|
||||
with_items:
|
||||
- { regexp: 'NETWORKING_IPV6=.*', line: 'NETWORKING_IPV6=NO' }
|
||||
- { regexp: 'IPV6INIT=.*', line: 'IPV6INIT=no' }
|
||||
|
||||
- name: unactive ipv6 sshd
|
||||
lineinfile:
|
||||
dest: /etc/ssh/sshd_config
|
||||
insertafter: '^#ListenAddress 0.0.0.0'
|
||||
line: 'ListenAddress 0.0.0.0'
|
||||
|
||||
- name: disable ipv6 chronyd
|
||||
replace:
|
||||
dest: /etc/sysconfig/chronyd
|
||||
regexp: 'OPTIONS=*'
|
||||
replace: 'OPTIONS="-4"'
|
||||
Loading…
x
Reference in New Issue
Block a user