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

Create new type grubby::kernel_opt #8

Merged
merged 1 commit into from
Mar 26, 2021
Merged

Conversation

traylenator
Copy link
Contributor

A new type is added

grubby::kernel_opt{'foo':
  ensure => present,
  value  => 'bar',
  scope  => 'ALL',
}

The previous hash parameter grubby::kernel_opts is still valid
and now uses grubby::kernel_opt internally.

Motivation here is to increase flexibility of module allowing
kernel parameters to be added by other distinct modules.

manifests/kernel_opt.pp Outdated Show resolved Hide resolved
manifests/kernel_opt.pp Outdated Show resolved Hide resolved
manifests/kernel_opt.pp Outdated Show resolved Hide resolved
A new type is added

```puppet
grubby::kernel_opt{'foo':
  ensure => present,
  value  => 'bar',
  scope  => 'ALL',
}
```

The previous hash parameter `grubby::kernel_opts` is still valid
and now uses `grubby::kernel_opt` internally.

Motivation here is to increase flexibility of module allowing
kernel parameters to be added by other distinct modules.
@traylenator
Copy link
Contributor Author

And the fact that = is a word end makes the spaced value a lot easier I would hope.

@traylenator traylenator marked this pull request as draft March 26, 2021 10:29
@atsonkov
Copy link
Owner

This one is still marked as draft, but looks ready to merge, right?

@traylenator
Copy link
Contributor Author

Did some real world tests as I had not for the last few commits.

grubby::kernel_opt{'foobar':}

grubby::kernel_opt{'foot':
   value =>  'ball',
}

grubby::kernel_opt{'start':
   value => 'to',
}                             

resulted in:

args="ro console=ttyS0,115200 console=tty0 rd.auto net.ifnames=0 crashkernel=auto rhgb quiet consoleblank=0 $tuned_params sausage=dog alpha=beta gamma two two" foobar foot=ball start=to"

Following this

grubby::kernel_opt{'foobar':
  ensure => 'absent',
}

grubby::kernel_opt{'foot':
  ensure => 'absent',
   value =>  'ball',
}

grubby::kernel_opt{'start':
   value => 'from',
}

So delete two and change one , resulted in

args="ro console=ttyS0,115200 console=tty0 rd.auto net.ifnames=0 crashkernel=auto rhgb quiet consoleblank=0 $tuned_params sausage=dog alpha=beta gamma two two" start=from"

So all good. 👍

@traylenator traylenator marked this pull request as ready for review March 26, 2021 13:07
@atsonkov atsonkov merged commit 601d1e9 into atsonkov:master Mar 26, 2021
@atsonkov atsonkov linked an issue Mar 26, 2021 that may be closed by this pull request
@atsonkov atsonkov added the enhancement New feature or request label Mar 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add tests for adding/removing kernel options
2 participants