From 8896486606906cbb2f9dfe9b443722688470938b Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sun, 16 Dec 2012 10:32:05 +0900 Subject: [PATCH] Adds comments on handling quoted group vars --- lib/ansible/inventory/ini.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ansible/inventory/ini.py b/lib/ansible/inventory/ini.py index 17aee923b9a..f666c10cff4 100644 --- a/lib/ansible/inventory/ini.py +++ b/lib/ansible/inventory/ini.py @@ -169,7 +169,9 @@ class InventoryParser(object): raise errors.AnsibleError("variables assigned to group must be in key=value form") else: (k, v) = [e.strip() for e in line.split("=", 1)] + # When the value is a single-quoted or double-quoted string if re.match(r"^(['\"]).*\1$", v): + # Unquote the string group.set_variable(k, re.sub(r"^['\"]|['\"]$", '', v)) else: group.set_variable(k, v)