This repository has been archived on 2026-11-16. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
openstack-deployment/ansible/playbooks/initial-config-ovs-dpdk-tmp-2.yml
T
2020-08-12 00:02:27 +03:00

43 lines
1.3 KiB
YAML

---
- hosts: bonchvisors
remote_user: cephadmin
become: true
become_user: root
become_method: sudo
tasks:
- name: enable isolcpu and hugepages in kernel
shell: grep GRUB_CMDLINE_LINUX /etc/default/grub | grep -c "hugepages" || true
register: hugepages_status
ignore_errors: true
- name: enable isolcpu in kernel
shell: grep GRUB_CMDLINE_LINUX /etc/default/grub | grep -c "isolcpus" || true
register: isolcpu_status
ignore_errors: true
- name: Enable isolcpu in grub
lineinfile: dest="/etc/default/grub" regexp='GRUB_CMDLINE_LINUX="(.*)"' line='GRUB_CMDLINE_LINUX="\1 isolcpus=2-3"' backrefs=yes
when: isolcpu_status.stdout == "0"
- name: Enable hugepages in grub
lineinfile: dest="/etc/default/grub" regexp='GRUB_CMDLINE_LINUX="(.*)"' line='GRUB_CMDLINE_LINUX="\1 hugepages=512"' backrefs=yes
when: hugepages_status.stdout == "0"
- name: check if hugepages fstab entry exist
shell: grep "^hugetlbfs" /etc/fstab || true
args:
executable: /bin/bash
register: test_grep
- name: test_grep results
debug:
msg: "{{ test_grep.stdout }}"
- name: modify fstab
lineinfile:
path: /etc/fstab
line: "nodev /mnt/huge hugetlbfs defaults 0 0"
when: test_grep.stdout == ""