Inventory: support list of vars in host.

This commit is contained in:
Jeroen Hoekx
2012-05-08 09:19:55 +02:00
parent 9b741a1d16
commit d419a13ca7
3 changed files with 17 additions and 2 deletions

View File

@@ -258,6 +258,14 @@ class TestInventory(unittest.TestCase):
'hammer':True,
'inventory_hostname': 'thor'}
def test_yaml_list_vars(self):
inventory = self.yaml_inventory()
vars = inventory.get_variables('zeus')
assert vars == {'ansible_ssh_port': 3001,
'group_names': ['greek', 'ruler'],
'inventory_hostname': 'zeus',
'ntp_server': 'olympus.example.com'}
def test_yaml_change_vars(self):
inventory = self.yaml_inventory()
vars = inventory.get_variables('thor')

View File

@@ -6,7 +6,9 @@
moon: titan
moon2: enceladus
- zeus
- host: zeus
vars:
- ansible_ssh_port: 3001
- group: greek
hosts: