From f8d04bec1bbdfb0e61e6d3255b16b5bfe23b42f1 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Sun, 22 Mar 2015 22:16:37 -0500 Subject: [PATCH] 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 --- system/lvol.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/lvol.py b/system/lvol.py index d9be9e7dc70..b14fd33c8e4 100644 --- a/system/lvol.py +++ b/system/lvol.py @@ -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: