Use -f when pvcreate to avoid interactive input. Fix https://github.com/ansible/ansible-modules-extras/issues/1504

pull/18777/head
Yannig Perré 9 years ago committed by Matt Clay
parent 801e895f62
commit bf5fbfe2a7

@ -183,7 +183,7 @@ def main():
### create PV ### create PV
pvcreate_cmd = module.get_bin_path('pvcreate', True) pvcreate_cmd = module.get_bin_path('pvcreate', True)
for current_dev in dev_list: for current_dev in dev_list:
rc,_,err = module.run_command("%s %s" % (pvcreate_cmd,current_dev)) rc,_,err = module.run_command("%s -f %s" % (pvcreate_cmd,current_dev))
if rc == 0: if rc == 0:
changed = True changed = True
else: else:
@ -224,7 +224,7 @@ def main():
### create PV ### create PV
pvcreate_cmd = module.get_bin_path('pvcreate', True) pvcreate_cmd = module.get_bin_path('pvcreate', True)
for current_dev in devs_to_add: for current_dev in devs_to_add:
rc,_,err = module.run_command("%s %s" % (pvcreate_cmd, current_dev)) rc,_,err = module.run_command("%s -f %s" % (pvcreate_cmd, current_dev))
if rc == 0: if rc == 0:
changed = True changed = True
else: else:

Loading…
Cancel
Save