system/lvol: Suppress prompts from lvcreate

Occasionally, `lvcreate` will prompt on stdin for confirmation. In
particular, this may happen when the volume is being created close to
the location on disk where another volume existed previously. When this
happens, Ansible will hang indefinitely with no indication of the
problem. To work prevent this problem, the `--yes` command-line argument
can be passed to `lvcreate`, which will instruct it not to prompt.

Signed-off-by: Dustin C. Hatch <dustin@hatch.name>
This commit is contained in:
Dustin C. Hatch 2015-03-22 22:16:37 -05:00 committed by Matt Clay
parent 8efd7d217e
commit 3e5a7bd475

View file

@ -187,7 +187,7 @@ def main():
changed = True
else:
lvcreate_cmd = module.get_bin_path("lvcreate", required=True)
rc, _, err = module.run_command("%s -n %s -%s %s%s %s" % (lvcreate_cmd, lv, size_opt, size, size_unit, vg))
rc, _, err = module.run_command("%s --yes -n %s -%s %s%s %s" % (lvcreate_cmd, lv, size_opt, size, size_unit, vg))
if rc == 0:
changed = True
else: