diff --git a/linux-kernel-sysctl/tasks/main.yml b/linux-kernel-sysctl/tasks/main.yml index 5937c7b7..0474e726 100644 --- a/linux-kernel-sysctl/tasks/main.yml +++ b/linux-kernel-sysctl/tasks/main.yml @@ -20,7 +20,8 @@ when: not disable_ipv6 - name: Set the custom sysctl values - 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(omit) }}' + 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 tags: [ 'sysctl', 'kernel' ]