voxpupuli / puppet-augeasproviders_grub

Augeas-based grub type and providers
Apache License 2.0
9 stars 33 forks source link

New menu entry Ubuntu 16.04 #43

Open tisauro opened 5 years ago

tisauro commented 5 years ago

Hi,

I am trying to create a new menu entry in Ubuntu 16.04 using the sample provided

grub_menuentry { 'new_entry':
    root           => '(hd0,0)',
    kernel         => ':preserve:',
    initrd         => ':preserve:',
    kernel_options => [':preserve:']
  }

however when I apply it to my node I get the error

Debug: Puppet::Type::Grub_menuentry::ProviderGrub2: file grubby does not exist
Debug: Puppet::Type::Grub_menuentry::ProviderGrub: file grub does not exist
Error: Could not find a suitable provider for grub_menuentry

is there anything I missing?

many thanks in advance Kind regards, Mauro

raphink commented 5 years ago

The grub_menuentry type requires either grub or grubby commands. It seems recent Ubuntu versions don't have them. @trevor-vaughan do you know what needs to be used instead?

trevor-vaughan commented 5 years ago

@raphink Yep, someone needs to go write a parser for all of GRUB2 that does what grubby does in terms of information retrieval. I don't Ubuntu so, until EL drops grubby, totally not volunteering for this one.

Basically, just run grubby --info DEFAULT (and for individual kernels) and find a way to get all of that info.

raphink commented 5 years ago

Ack. I use Ubuntu but I don't manage grub stuff with Puppet. Ubuntu doesn't have grubby so I can't check the output. Bottom line so far, we'd welcome a PR to fix that in a proper way in Debian-based OSes @tisauro

trevor-vaughan commented 5 years ago

As a quick check to see if there was some reason that grubby wasn't available for Ubuntu, I spun up a 1604 system, snagged the repo from https://github.com/rhboot/grubby, built it and it worked just fine.

Honestly, I'd recommend that someone ask Ubuntu to include it instead of trying to reinvent the wheel.