Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new parameter to prevent grub-mkconfig being run #59

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/puppet/provider/grub_config/grub2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ def flush
fail("Cannot find grub.cfg location to use with grub-mkconfig") unless cfg

super
mkconfig "-o", cfg

if mkconfig
mkconfig "-o", cfg
end
cedws marked this conversation as resolved.
Show resolved Hide resolved
end
end
4 changes: 3 additions & 1 deletion lib/puppet/provider/grub_menuentry/grub2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,9 @@ def flush
FileUtils.rm_f(legacy_target)

# Need to rebuild the full grub config if we removed a legacy target
grub2_mkconfig
if mkconfig
grub2_mkconfig
end
end
end
else
Expand Down
4 changes: 3 additions & 1 deletion lib/puppet/provider/grub_user/grub2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,9 @@ def flush
FileUtils.chmod(0755, resource[:target])
end

mkconfig "-o", grub2_cfg_path
if mkconfig
mkconfig "-o", grub2_cfg_path
end
cedws marked this conversation as resolved.
Show resolved Hide resolved
end

private
Expand Down
9 changes: 6 additions & 3 deletions lib/puppet/provider/kernel_parameter/grub2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,11 @@ def flush
fail("Cannot find grub.cfg location to use with grub-mkconfig") unless cfg

super
cfg.each {|c|
mkconfig "-o", c
}

if mkconfig
cfg.each {|c|
mkconfig "-o", c
}
end
end
end
7 changes: 7 additions & 0 deletions lib/puppet/type/grub_user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@
end
end

newparam(:mkconfig, :boolean => true) do
cedws marked this conversation as resolved.
Show resolved Hide resolved
desc "Whether grub(2)-mkconfig should be ran after updating the GRUB configuration"

newvalues(:true, :false)
defaultto(:true)
end

newproperty(:purge, :boolean => true) do
desc <<-EOM
Purge all unmanaged users.
Expand Down
7 changes: 7 additions & 0 deletions lib/puppet/type/kernel_parameter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@
defaultto :all
end

newparam(:mkconfig, :boolean => true) do
cedws marked this conversation as resolved.
Show resolved Hide resolved
desc "Whether grub(2)-mkconfig should be ran after updating the GRUB configuration"

newvalues(:true, :false)
defaultto(:true)
end

autorequire(:file) do
self[:target]
end
Expand Down