Add EFI support for grub.cfg generation 08/2108/4
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Mon, 9 Dec 2019 14:20:59 +0000 (15:20 +0100)
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Wed, 11 Dec 2019 18:44:20 +0000 (19:44 +0100)
On UEFI-enabled systems, the location of grub.cfg is different.

Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Change-Id: I0fefe733587ca1fb0f12975eadfaad2e19fbd02c

ansible/roles/security/tasks/main.yml
rpmbuild.spec

index 22e3197..acf307a 100644 (file)
       - host_os is defined
       - host_os.grub2_password | default(False, True)
 
+  - name: check whether grub-efi exists
+    stat:
+      path: /boot/efi/EFI/centos/grub.cfg
+    register: grub_efi_file_stat
+
   - name: generate grub config
     command: /usr/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg
 
+  - name: generate grub-efi config
+    command: /usr/sbin/grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg
+    when: grub_efi_file_stat.stat.exists == true
+
   - name: chsh/chfn right setting
     file:
       path: "{{ item }}"
index bae2da4..ee00155 100644 (file)
@@ -15,7 +15,7 @@
 %define COMPONENT security
 %define RPM_NAME caas-%{COMPONENT}
 %define RPM_MAJOR_VERSION 1.0.0
-%define RPM_MINOR_VERSION 9
+%define RPM_MINOR_VERSION 10
 
 Name:           %{RPM_NAME}
 Version:        %{RPM_MAJOR_VERSION}