From c0e28762f06d36bda15f914df791ab5a089dff91 Mon Sep 17 00:00:00 2001 From: Nigel Metheringham Date: Wed, 13 Feb 2013 14:15:22 +0000 Subject: [PATCH] Allow end of line comments in inventory file See github issue 2702 https://github.com/ansible/ansible/issues/2072 --- 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 a5da915572..d79a148894 100644 --- a/lib/ansible/inventory/ini.py +++ b/lib/ansible/inventory/ini.py @@ -109,6 +109,8 @@ class InventoryParser(object): self.hosts[hn] = host if len(tokens) > 1: for t in tokens[1:]: + if t.startswith('#'): + break (k,v) = t.split("=") host.set_variable(k,v) self.groups[active_group_name].add_host(host)