sous-chefs / lvm

Development repository for the lvm cookbook
https://supermarket.chef.io/cookbooks/lvm
Apache License 2.0
56 stars 122 forks source link

pvcreate gets stuck if the device has a valid filesystem signature #217

Closed hamarituc closed 2 years ago

hamarituc commented 2 years ago

:ghost: Brief Description

If you try to create a physical volume on a device, which contains a valid file system signature, the chef infra client run will get stuck, because pvcreate asks for confirmation interactively.

:pancakes: Cookbook version

5.2.1

:woman_cook: Chef-Infra Version

16.16.13

:tophat: Platform details

Debian 11

Steps To Reproduce

Steps to reproduce the behavior:

  1. Format the device. Let's assume /dev/vdb1 (Caution: This will destroy all your data. Please use a test device. You have been warned)
# mkfs.vfat /dev/vdb1
  1. Initialize the physical volume
lvm_physical_volume '/dev/vdb1' do
  action :create
end

:police_car: Expected behavior

Chef infra client run will fail with an error message.

:heavy_plus_sign: Additional context

If the wipe_signatures is set, no error will occur as the --yes option is appended to pvcreate an the signature will be wiped. If wipe_signatures is not set, the -qq option should be appended to pvcreate, to bail out immediately instead of performing interactive input queries.

I will provide a pull request.

hamarituc commented 2 years ago

closed via #218