Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ansible/roles/host_setup/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,8 @@ host_ntp_server:

# Default tuned profile
tuned_profile: throughput-performance

# https://www.freedesktop.org/software/systemd/man/latest/systemd-system.conf.html
systemd_CPUAffinity: numa
systemd_NUMAPolicy: local
systemd_NUMAMask: all
15 changes: 15 additions & 0 deletions ansible/roles/host_setup/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,21 @@
group: "root"
mode: "0755"

- name: Get systemd version
tags:
- always
- skip_ansible_lint
block:
- name: Pull systemd version
ansible.builtin.command: >-
/usr/bin/systemctl --version --no-pager
register: get_systemd_version
changed_when: false
check_mode: false
- name: Set systemd version
ansible.builtin.set_fact:
systemd_version: "{{ get_systemd_version.stdout_lines[0].split()[-1] }}"

- name: Add DefaultEnvironment to systemd
ansible.builtin.template:
src: genestack-default-environment.conf.j2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
{% endfor %}
DefaultEnvironment = {{ envList | join(' ') }}
DefaultLimitNOFILE = 65536:524288
CPUAffinity = numa
NUMAPolicy = local
NUMAMask = all
CPUAffinity = {{ (systemd_NUMAMask == "all") | ternary("", systemd_CPUAffinity) }}
{% if (systemd_version | int) >= 243 %}
NUMAPolicy = {{ systemd_NUMAPolicy }}
NUMAMask = {{ systemd_NUMAMask }}
{% endif %}