Use -f when pvcreate to avoid interactive input.

Fix https://github.com/ansible/ansible-modules-extras/issues/1504
This commit is contained in:
Yannig Perré 2016-01-15 16:33:42 +01:00
parent 90db7af7a7
commit c276d9f621

View file

@ -183,7 +183,7 @@ def main():
### create PV
pvcreate_cmd = module.get_bin_path('pvcreate', True)
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:
changed = True
else:
@ -224,7 +224,7 @@ def main():
### create PV
pvcreate_cmd = module.get_bin_path('pvcreate', True)
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:
changed = True
else: