diff options
author | 2017-12-22 11:42:15 +0000 | |
---|---|---|
committer | 2017-12-22 11:42:15 +0000 | |
commit | d93f0b4e79bcf822dfb264a82e879f45038628d1 (patch) | |
tree | 76d71ba9f071ef0f9d8ebaabf447259a1cf7593d /ansible/roles/enable_hugepages_on_boot/tasks/manual_modify_grub.yml | |
parent | 9bef739e89f3b230c9e0a53c2286a440017ec948 (diff) | |
parent | d2c4c4f8a798506ee88d0412ee1ab7cae5f394e5 (diff) |
Merge "Bugfix in role enable_hugepages_on_boot"
Diffstat (limited to 'ansible/roles/enable_hugepages_on_boot/tasks/manual_modify_grub.yml')
-rw-r--r-- | ansible/roles/enable_hugepages_on_boot/tasks/manual_modify_grub.yml | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/ansible/roles/enable_hugepages_on_boot/tasks/manual_modify_grub.yml b/ansible/roles/enable_hugepages_on_boot/tasks/manual_modify_grub.yml index cac10e80e..6fa0c1d25 100644 --- a/ansible/roles/enable_hugepages_on_boot/tasks/manual_modify_grub.yml +++ b/ansible/roles/enable_hugepages_on_boot/tasks/manual_modify_grub.yml @@ -20,16 +20,17 @@ recurse: yes register: grub_files +- name: check if hugepages are already enabled + command: "grep -o 'default_hugepagesz=' {{ item.path }}" + register: hugepage_enabled + ignore_errors: True + with_items: "{{ grub_files.files }}" -- name: added hugepages to grub manually because we can't run update-grub in chroot +- name: add hugepages to grub manually because we can't run update-grub in chroot replace: dest: "{{ item.path }}" - # console= should end the line - regexp: '(linux\s+/boot/vmlinuz.*console=\S+$)' - # default_hugepagesz=1G hugepagesz=1G hugepages=8 + regexp: '(linux\s+/boot/vmlinuz.*$)' replace: '\1 default_hugepagesz={{ huge_pagesize_short[huge_pagesize_mb] }} hugepagesz={{ huge_pagesize_short[huge_pagesize_mb] }} hugepages={{ num_hugepages }}' with_items: "{{ grub_files.files }}" - - - - + # we suppose consistent /boot/grub/grub.cfg files + when: hugepage_enabled['results'][0].stdout == "" |