Ansible role for enabling or disabling IPv6 via sysctl.
- Alpine
- Amazonlinux
- Archlinux
- CentOS
- Debian
- Fedora
- Manjaro
- OracleLinux
- OpenSuse Leap, Tumbleweed
- Ubuntu
Ansible 2.9 or higher is recommended.
Removed GRUB
, modprobe
and ifcg-script
options for simplicity,
as IPv6 module is builtin in the most kernels by default.
Variables and defaults for this role:
---
# role: ansible-role-ipv6
# file: defaults/main.yml
# The role is disabled by default, so you do not get in trouble.
# Checked in tasks/main.yml which includes tasks.yml if enabled.
ipv6_role_enabled: false
# Disable IPv6 via sysctl by default.
# This only results to no IPv6 addresses being assigned to any interface.
# The kernel module is still active, if this is your os default.
ipv6_disable_sysctl: true
# Configuration file for sysctl
ipv6_sysctl_file: "/etc/sysctl.d/98-ipv6.conf"
- ansible-role-hosts (optional)
---
# role: ansible-role-ipv6
# file: site.yml
- hosts: all
become: true
vars:
ipv6_role_enabled: true
roles:
- role: ansible-role-ipv6
Licensed under MIT License. See LICENSE file in repository.