From ffe002a319c3946afdacfbde7d3895daa7c5ae0c Mon Sep 17 00:00:00 2001 From: Daniel 'f0o' Preussker Date: Sun, 19 Jan 2025 07:17:10 +0000 Subject: [PATCH] Make sysctl configuration path configurable Defaults to /etc/sysctl.conf to retain current behavior Change-Id: Ifab2b86b38fdf2706eecb6a846ecd6e1c5a8714b --- defaults/main.yml | 2 ++ tasks/configure_metal_hosts.yml | 1 + tasks/main.yml | 1 + 3 files changed, 4 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index 9a17ab62..4c2fbbf4 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -227,3 +227,5 @@ openstack_hosts_systemd_slice: "openstack-hosts" # and referenced using the file:// method. # openstack_hosts_git_safe_directories: # - "*" + +openstack_hosts_sysctl_file: "{{ openstack_sysctl_file | default('/etc/sysctl.conf') }}" diff --git a/tasks/configure_metal_hosts.yml b/tasks/configure_metal_hosts.yml index 2469f82f..7d51bcf4 100644 --- a/tasks/configure_metal_hosts.yml +++ b/tasks/configure_metal_hosts.yml @@ -76,6 +76,7 @@ name: "{{ item.key }}" value: "{{ item.value }}" sysctl_set: "{{ item.set | default('yes') }}" + sysctl_file: "{{ openstack_hosts_sysctl_file }}" state: "{{ item.state | default('present') }}" reload: no with_items: "{{ openstack_kernel_options + openstack_user_kernel_options }}" diff --git a/tasks/main.yml b/tasks/main.yml index 275a7e82..4cb27b0d 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -122,6 +122,7 @@ name: "net.ipv4.tcp_retries2" value: "{{ keepalived_sysctl_tcp_retries | default(8) }}" sysctl_set: yes + sysctl_file: "{{ openstack_hosts_sysctl_file }}" state: "{{ (keepalived_sysctl_tcp_retries | default(8) > 0) | ternary('present', 'absent') }}" reload: yes failed_when: false