From 3e5a7bd475c37f2163b54f5148e4959e876d594a 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 --- lib/ansible/modules/extras/system/lvol.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/extras/system/lvol.py b/lib/ansible/modules/extras/system/lvol.py index d1e144157f4..888e246fe41 100644 --- a/lib/ansible/modules/extras/system/lvol.py +++ b/lib/ansible/modules/extras/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: