From f28958e463c979ef9f9bea24ef5e8cfb6e7ef982 Mon Sep 17 00:00:00 2001 From: Markus Katharina Brechtel Date: Sun, 22 Oct 2017 23:29:43 +0000 Subject: [PATCH] let user choose grub_bootloader_target --- tasks/main.yml | 6 +++++- templates/grub-install.args.j2 | 12 ++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 templates/grub-install.args.j2 diff --git a/tasks/main.yml b/tasks/main.yml index a38cece..6fd89bf 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -11,7 +11,11 @@ dest: "{{ root_target_directory }}/etc/default/grub" - name: grub-install - command: chroot {{ root_target_directory }} grub-install {{ item }} + command: + chroot {{ root_target_directory }} + grub-install + {{ lookup('template','grub-install.args.j2') }} + {{ item }} with_items: "{{ boot_devices }}" - name: update-grub diff --git a/templates/grub-install.args.j2 b/templates/grub-install.args.j2 new file mode 100644 index 0000000..d25b798 --- /dev/null +++ b/templates/grub-install.args.j2 @@ -0,0 +1,12 @@ +{% if grub_bootloader_target is defined %} +--target={{ grub_bootloader_target }} +{% endif %} +{% if efi_directory is defined %} +--efi-directory={{efi_directory}} +{% endif %} +{% if grub_bootloader_id is defined %} +--bootloader-id={{grub_bootloader_id}} +{% endif %} +{% if grub_bootloader_recheck is defined and grub_bootloader_recheck %} +--recheck +{% endif %}