コード例 #1
0
ファイル: inventory.py プロジェクト: ployground/ploy_ansible
 def get_variables(self, hostname, **kwargs):
     result = BaseInventory.get_variables(self, hostname, **kwargs)
     if hasattr(self, 'get_host_variables'):
         result = utils.combine_vars(
             result,
             self.get_host_variables(
                 hostname, vault_password=self._vault_password))
     return PloyInventoryDict(result)
コード例 #2
0
ファイル: TestInventory.py プロジェクト: threatgrid/ansible
 def test_simple_string_fqdn_vars(self):
     inventory = Inventory('foo.example.com:2222,bar.example.com')
     var = inventory.get_variables('foo.example.com')
     self.assertEqual(var['ansible_ssh_port'], 2222)
コード例 #3
0
ファイル: TestInventory.py プロジェクト: threatgrid/ansible
 def test_simple_string_ipv6_vars(self):
     inventory = Inventory('[FE80:EF45::12:1]:2222,192.168.1.1')
     var = inventory.get_variables('FE80:EF45::12:1')
     self.assertEqual(var['ansible_ssh_port'], 2222)
コード例 #4
0
ファイル: TestInventory.py プロジェクト: threatgrid/ansible
 def test_simple_string_ipv4_vars(self):
     inventory = Inventory('127.0.0.1:2222,192.168.1.1')
     var = inventory.get_variables('127.0.0.1')
     self.assertEqual(var['ansible_ssh_port'], 2222)
コード例 #5
0
ファイル: TestInventory.py プロジェクト: ferhaty/ansible
 def test_simple_string_fqdn_vars(self):
     inventory = Inventory('foo.example.com:2222,bar.example.com')
     var = inventory.get_variables('foo.example.com')
     self.assertEqual(var['ansible_ssh_port'], 2222)
コード例 #6
0
ファイル: TestInventory.py プロジェクト: ferhaty/ansible
 def test_simple_string_ipv6_vars(self):
     inventory = Inventory('[FE80:EF45::12:1]:2222,192.168.1.1')
     var = inventory.get_variables('FE80:EF45::12:1')
     self.assertEqual(var['ansible_ssh_port'], 2222)
コード例 #7
0
ファイル: TestInventory.py プロジェクト: ferhaty/ansible
 def test_simple_string_ipv4_vars(self):
     inventory = Inventory('127.0.0.1:2222,192.168.1.1')
     var = inventory.get_variables('127.0.0.1')
     self.assertEqual(var['ansible_ssh_port'], 2222)
コード例 #8
0
ファイル: TestInventory.py プロジェクト: sriramnrn/ansible
 def test_simple_string_ipv6_vars(self):
     inventory = Inventory("[FE80:EF45::12:1]:2222,192.168.1.1")
     var = inventory.get_variables("FE80:EF45::12:1")
     self.assertEqual(var["ansible_ssh_port"], 2222)