Skip to content
This repository has been archived by the owner on Nov 8, 2019. It is now read-only.

LWRP focused rewrite #6

Closed
wants to merge 3 commits into from
Closed

LWRP focused rewrite #6

wants to merge 3 commits into from

Conversation

mal
Copy link
Contributor

@mal mal commented Jun 8, 2014

I was having some issues reverting values, so I started down a path to cache the defaults as they're removed and kept tweaking and tweaking and here we are.

I completely understand if you'd prefer to leave this as a separate fork, but I thought I'd offer it up and let you decide for youselves.

Rather than duplicate everything here, the best option is to skim over the updated usage section in the readme for starters, and then then continue below where I'll outline the less visible changes.


  • These changes address #1 by way of the conclusion reached in this Chef Bug tracker issue. The result of trying to set an invalid or unsupported key is an explicit error explain that. The best way to handle this would be using the LWRP and something similar to not_if platform_family?('freebsd') to prevent the attempt to set keys based on platform.
  • They also address the caching issue mentioned above, allowing :remove to immediately return parameter values to their system default.
  • Everything goes through the LWRP, so if a config file is available values will always be persisted in the course of the chef run (with the ability to force the write sooner using action :save.
  • Support for flat keys i.e. 'vm.swappiness' => 20 and vm: { swappiness: 20 } render the same outcome
  • Fix issue where if key was removed from node.sysctl.params in a subsequent convergence, the value would be removed from the persisted file, but not unset from the server, violating the expected idempotent behaviour of cookbooks
  • Fix whyrun? support as it was claiming to support whyrun behavior and then changing kernel values in what should have been dry runs.
  • Split out BSD testing into a separate suite due to current suites using keys BSD does not support.

I've run the full test suite against this PR and it passes with two exceptions; the first is the integration tests for fedora-20 which fails for me due to this vagrant issue (but it passes once the suite is restarted), and the second is a foodcritic issue which I believe to be a false positive.

Happy to answer any questions you may have.

@mal
Copy link
Contributor Author

mal commented Jun 15, 2014

Fixed tests (was testing the for the wrong directory on BSD).

Also managed to work around the FC false positive, and solved another issue by upgrading to a post 4.0.0 commit of chefspec (issue here).

@svanzoest
Copy link
Contributor

Hi @mal,

I appreciate your contributions. As you say this changes the syntax quite a bit, so we will need to look at the pros and cons of that approach a bit. I am currently focusing all my free time on the apache2 cookbook, but hopefully will look at this next week.

@mal
Copy link
Contributor Author

mal commented Jun 16, 2014

Thanks, appreciate the heads up. Look forward to hearing your thoughts next week!

@mal
Copy link
Contributor Author

mal commented Sep 7, 2014

Rebased and added some basic code to support testing of arch as soon as fauxhai supports it.

@mal
Copy link
Contributor Author

mal commented Dec 8, 2014

@svanzoest pre-christmas personal PR triage, any hope for movement on this one?

@mal
Copy link
Contributor Author

mal commented Feb 4, 2015

Closing due to lack of interest and the fact that it will now require further work to make it mergeable.

@mal mal closed this Feb 4, 2015
@lock
Copy link

lock bot commented Nov 7, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Nov 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants