mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Support dicts in inventory vars.
This commit is contained in:
@@ -220,13 +220,13 @@ class TestInventory(unittest.TestCase):
|
||||
inventory = self.yaml_inventory()
|
||||
vars = inventory.get_variables('saturn')
|
||||
|
||||
assert vars == {"moon":"titan"}
|
||||
assert vars == {"moon":"titan", "moon2":"enceladus"}
|
||||
|
||||
def test_yaml_port(self):
|
||||
inventory = self.yaml_inventory()
|
||||
vars = inventory.get_variables('hera')
|
||||
|
||||
assert vars == {'ansible_ssh_port': 3000}
|
||||
assert vars == {'ansible_ssh_port': 3000, 'ntp_server': 'olympus.example.com'}
|
||||
|
||||
### Test Runner class method
|
||||
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
- jupiter
|
||||
- host: saturn
|
||||
vars:
|
||||
- moon: titan
|
||||
moon: titan
|
||||
moon2: enceladus
|
||||
|
||||
- zeus
|
||||
|
||||
@@ -14,6 +15,7 @@
|
||||
- poseidon
|
||||
vars:
|
||||
- ansible_ssh_port: 3000
|
||||
- ntp_server: olympus.example.com
|
||||
|
||||
- group: norse
|
||||
hosts:
|
||||
|
||||
Reference in New Issue
Block a user