2016-10-11 17:37:33 +02:00
|
|
|
---
|
|
|
|
- block:
|
|
|
|
- name: Ensure that the /etc/sysctl.d directory exists
|
|
|
|
file: path=/etc/sysctl.d state=directory owner=root group=root
|
|
|
|
|
|
|
|
- name: Disable the in kernel ipv6 support
|
|
|
|
sysctl: name={{ item }} value=1 sysctl_file={{ ipv6_sysctl_file }} reload=yes state=present
|
|
|
|
with_items:
|
|
|
|
- net.ipv6.conf.all.disable_ipv6
|
|
|
|
- net.ipv6.conf.default.disable_ipv6
|
|
|
|
- net.ipv6.conf.lo.disable_ipv6
|
|
|
|
when: disable_ipv6
|
|
|
|
|
|
|
|
- name: enable the in kernel ipv6 support
|
|
|
|
sysctl: name={{ item }} value=0 sysctl_file={{ ipv6_sysctl_file }} reload=yes state=present
|
|
|
|
with_items:
|
|
|
|
- net.ipv6.conf.all.disable_ipv6
|
|
|
|
- net.ipv6.conf.default.disable_ipv6
|
|
|
|
- net.ipv6.conf.lo.disable_ipv6
|
|
|
|
when: not disable_ipv6
|
|
|
|
|
|
|
|
- name: Set the custom sysctl values
|
2016-10-11 18:19:58 +02:00
|
|
|
sysctl: name={{ item.name }} value={{ item.value }} sysctl_file={{ item.sysctlfile | default ('/etc/sysctl.d/90-custom-values.conf') }} reload={{ item.sysctl_reload | default(yes) }} state={{ item.sysctlfile_state | default('present') }}
|
|
|
|
with_items: '{{ systemctl_custom_options | default([]) }}'
|
|
|
|
when: systemctl_custom_options is defined
|
2016-10-11 17:37:33 +02:00
|
|
|
|
|
|
|
tags: [ 'sysctl', 'kernel' ]
|