diff options
author | Stepan Andrushko <stepanx.andrushko@intel.com> | 2019-02-27 13:40:13 +0200 |
---|---|---|
committer | Stepan Andrushko <stepanx.andrushko@intel.com> | 2019-02-27 13:40:13 +0200 |
commit | 60d07cf9a6ab763852d3c1db519aab0e8e3394fe (patch) | |
tree | 149d083995732dacd2a7c80815447d61b80aeda1 /ansible/roles/enable_iommu_on_boot/tasks | |
parent | 4c995d8a3ad25afe2ad8d75d43c7519ce22797eb (diff) |
Update grub in enable_iommu_on_boot when needed
Improve conditions when to update grub in enable_iommu_on_boot
ansible role.
JIRA: YARDSTICK-1603
Change-Id: Ic16b84beb55e45e4b75c120761397dc3207ef6f4
Signed-off-by: Stepan Andrushko <stepanx.andrushko@intel.com>
Diffstat (limited to 'ansible/roles/enable_iommu_on_boot/tasks')
-rw-r--r-- | ansible/roles/enable_iommu_on_boot/tasks/main.yml | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/ansible/roles/enable_iommu_on_boot/tasks/main.yml b/ansible/roles/enable_iommu_on_boot/tasks/main.yml index 188b32915..2772a5d52 100644 --- a/ansible/roles/enable_iommu_on_boot/tasks/main.yml +++ b/ansible/roles/enable_iommu_on_boot/tasks/main.yml @@ -54,25 +54,26 @@ - not is_nsb_iommu_role.changed - is_iommu.changed - - name: Add IOMMU when it is not set - lineinfile: - path: "{{ grub_file }}" - regexp: "{{ iommu_help_string }}" - line: '{{ enable_iommu }}" {{ iommu_help_string }}' + - block: + - name: Add IOMMU when it is not set + lineinfile: + path: "{{ grub_file }}" + regexp: "{{ iommu_help_string }}" + line: '{{ enable_iommu }}" {{ iommu_help_string }}' + + - name: find boot grub.cfg + find: + paths: /boot + file_type: file + patterns: 'grub*.cfg' + recurse: yes + register: grub_files + + - include: manual_modify_grub.yml + # only tested on Ubuntu, kernel line is probably different on other distros + with_items: "{{ grub_files.files }}" when: + - ansible_distribution == "Ubuntu" - not is_nsb_iommu_role.changed - not is_iommu.changed - - - name: find boot grub.cfg - find: - paths: /boot - file_type: file - patterns: 'grub*.cfg' - recurse: yes - register: grub_files - - - include: manual_modify_grub.yml - # only tested on Ubuntu, kernel line is probably different on other distros - with_items: "{{ grub_files.files }}" - when: ansible_distribution == "Ubuntu" when: iommu_boot_params is defined |