32 lines
855 B
YAML
32 lines
855 B
YAML
---
|
|
- 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'
|