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

Fix mkconfig calls #64

Merged
merged 1 commit into from
Jan 14, 2021
Merged

Conversation

trevor-vaughan
Copy link
Contributor

Fixed:

  • Moved the puppetx/augeasproviders_grub/menuentry.rb file to util.rb
    to match the module name
  • Modified all flush functions to call the 'global update' mkconfig
    which was added as PuppetX::AugeasprovidersGrub::Util.mkconfig
  • Removed EL6 from the beaker tests since the OS is no longer
    supported by the vendor and fails to run

Added:

  • Puppet 7 support
  • EL8 support

Closes #63

Copy link
Member

@raphink raphink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's quite a large change, but LGTM

@traylenator
Copy link
Contributor

Testing this not having much luck, with

kernel_parameter{'consoleblank':
  ensure => present,
  value  => '0',
}

Nothing much seems to happen,

I would have expected it to be visible in the following:

# grub2-editenv - list
saved_entry=8acfa3bfcd324a25b72ef69f6bf3caa1-4.18.0-240.1.1.el8_3.x86_64
kernelopts=root=UUID=52a70118-54f4-4c82-8316-86ae34073a0e ro console=ttyS0,115200 console=tty0 rd.auto net.ifnames=0 crashkernel=auto rhgb quiet 

Using

  • herculesteam-augeasproviders 2.1.3
  • herculesteam-augeasproviders_base 2.0.1
  • herculesteam-augeasproviders_core 2.1.2

@traylenator
Copy link
Contributor

Updated augeasproviders_core to 2.6.0 since grub was > 2.4.0

Same result.

@traylenator
Copy link
Contributor

Running with debug , with a parameter that was not set:

Notice: /Stage[main]/Main/Kernel_parameter[foo]/value: value changed ['bar'] to ['other']
Debug: Executing: '/usr/sbin/grub2-mkconfig'
Debug: /Stage[main]/Main/Kernel_parameter[foo]: The container Class[Main] will propagate my refresh event

So grub2-mkconfig is called.

and node reboots

# cat /proc/cmdline 
BOOT_IMAGE=(hd0,gpt1)/boot/vmlinuz-4.18.0-240.1.1.el8_3.x86_64 root=UUID=52a70118-54f4-4c82-8316-86ae34073a0e ro console=ttyS0,115200 console=tty0 rd.auto net.ifnames=0 crashkernel=auto rhgb quiet consoleblank=0 foo=bar

So this seems okay.

@traylenator
Copy link
Contributor

It seems that grub2-mkconfig has changed such that it now works.

It used to result in a non-bootable system.

@trevor-vaughan
Copy link
Contributor Author

@traylenator Any chance you can help pinpoint the 'fixed' version of grub? I can add code to avoid running things if we're on a broken version.

I'm honestly surprised at this, you can't do everything through the new BLS material so it seems like this would have resulted in a lot of broken systems.

@traylenator
Copy link
Contributor

My guess from the changelog alone is:

* Mon May 20 2019 Javier Martinez Canillas <[email protected]> - 2.02-68
- blscfg: fallback to default_kernelopts if BLS option field isn't set
  Related: rhbz#1680572

@traylenator
Copy link
Contributor

* Tue Dec 11 2018 Javier Martinez Canillas <[email protected]> - 2.02-64
- Make grub2-mkconfig to honour GRUB_CMDLINE_LINUX in /etc/default/grub
  Resolves: rhbz#1637875

@trevor-vaughan
Copy link
Contributor Author

Thanks, that makes sense.

I don't know that I have time to consolidate the BLS detection materials into Utils right now but we can at least make this safer.

@trevor-vaughan
Copy link
Contributor Author

It looks like the original version of the OS shipped with 2.02-66, so the 2.02-68 limit appears to be the correct one and appears to be fixed at the first minor update (by a large jump). So this should be largely a non-issue on updated systems (but the safety hook still makes sense).

@traylenator
Copy link
Contributor

Glad that matches, I do have old images I could boot and test if needed.

@trevor-vaughan
Copy link
Contributor Author

We probably should add the BLS options based off of #60 but it'll take some additional integration work to make sure it trickles down everywhere.

@trevor-vaughan
Copy link
Contributor Author

Well, it turns out that the version matching is going to be almost impossible to make vendor neutral. So....I'm going to mark it as supporting EL 8.1+ in the metadata for now.

@trevor-vaughan trevor-vaughan force-pushed the fix_mkconfig_calls branch 2 times, most recently from 8f841c0 to a861639 Compare December 17, 2020 18:10
@trevor-vaughan
Copy link
Contributor Author

@raphink Added a warning to the README and bumped the metadata deps. Will try to refactor to use BLS as I can.

@trevor-vaughan
Copy link
Contributor Author

@raphink So, Travis CI is timing out for an unknown reason. I can try mucking about with the travis.yml but I think you either need to migrate to Travis.com or GitHub Actions.

@trevor-vaughan
Copy link
Contributor Author

Hold off on pushing this, debugging something in EL7

@trevor-vaughan
Copy link
Contributor Author

@traylenator Made an update to the way flush was calling things. This appears to correct some issues in our fips module tests. Can you take another poke to see if it works for you?

Currently having some issues with el8 and FIPS mode. They broke something in the stack and I'm trying to figure out what. Prior to 8.3 everything was fine.

@coveralls
Copy link

Coverage Status

Coverage decreased (-23.2%) to 72.177% when pulling deb1c1b on trevor-vaughan:fix_mkconfig_calls into 5378c62 on hercules-team:master.

@coveralls
Copy link

coveralls commented Dec 23, 2020

Coverage Status

Coverage decreased (-22.8%) to 72.581% when pulling 1bb6266 on trevor-vaughan:fix_mkconfig_calls into 5378c62 on hercules-team:master.

@trevor-vaughan
Copy link
Contributor Author

@raphink Managed to speed up the travis tests. Also, this is now working as expected.

Fixed:
  * Moved the puppetx/augeasproviders_grub/menuentry.rb file to util.rb
    to match the module name
  * Modified all `flush` functions to call the 'global update' mkconfig
    which was added as `PuppetX::AugeasprovidersGrub::Util.mkconfig`
  * Removed EL6 from the beaker tests since the OS is no longer
    supported by the vendor and fails to run

Added:
  * Puppet 7 support
  * EL8.1+ support

Changed:
  * Updated the travis.yml to run faster

Closes voxpupuli#63

fix super calls in flush

try to speed up travis builds

install unbuffer in travis

fix provider inheritance

add augeas tools
@trevor-vaughan
Copy link
Contributor Author

Rebased for a single commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The mkconfig update in #4 needs to be ported to the other providers
5 participants