lvm
lvm copied to clipboard
Path to lvm binary should be set by default
This is basically the same as the closed issue #133, that is still an issue with Chef 13 / 14.
Cookbook version
4.5.1
Chef-client version
14.5.33 with path_sanity disabled
Platform Details
RHEL 7.6
Scenario:
Create a PV on /dev/sdc
Steps to Reproduce:
cat lvm_test/recipes/lvm_test.rb
lvm_physical_volume '/dev/sdc'
export PATH='/bin/,/usr/bin'; chef-client -o lvm_test::lvm_test
Expected Result:
PV to be created
Actual Result:
Error executing action `create` on resource 'lvm_physical_volume[/dev/sdc]'
Errno::ENOENT
-------------
No such file or directory - pvs
Cookbook Trace:
---------------
/var/chef/cache/cookbooks/lvm/resources/physical_volume.rb:33:in `block in class_from_file'
Because of the change in path-sanity handling ( Ref: Chef 13 / 14 path-sanity behaviour ), we can no longer assume /sbin or /usr/sbin will always be in $PATH. Different Chef version and OS settings can now affect it as well. Therefore it seems more reliable to set the path to the lvm binary when calling it (good practice as well?).
This cookbook has recently been updated to have an internal attribute lvm_options when calling the lvm gem, eg LVM::LVM.new(lvm_options) (See examples within this cookbook)
Perhaps something similar can be done so that the command attribute is pass on to the lvm gem with the full path to lvm: LVM::LVM.new(command: '/sbin/lvm')
Hey There It looks like this is the first issue you've filed against the chef-cookbooks project. I'm here to offer you a bit of extra help to make sure we can quickly get back to you. Make sure you've filled out all the fields in our issue template. Make sure you've provided us with the version of chef-client you're running, your operating system and the version of the cookbook. If you're not using the most up to date version of the cookbook then please make sure to update first. Lots of things change between versions even if you're issue isn't listed in the changelog. Finally please give us a detailed description of the issue you're having. The more we know about what you're trying to do, what actually happens, and how you can reproduce the problem, the better.
If you're looking for more immediate troubleshooting help make sure to check out #general on the Chef Community Slack. There's plenty of folks there willing to lend a helping hand. Thanks for the first issue. We hope we can get back to you soon with a solution.
I can confirm the issue is reproducible in version 14.14.25 of the Chef-Client.
I am facing the same issue