mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-03-26 21:33:02 +00:00
Set the connection plugin and transport separately, add tests
This commit is contained in:
@@ -143,6 +143,7 @@ class K8sInventoryException(Exception):
|
||||
class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable, K8sAnsibleMixin):
|
||||
NAME = 'community.kubernetes.k8s'
|
||||
|
||||
connection_plugin = 'kubectl'
|
||||
transport = 'kubectl'
|
||||
|
||||
def parse(self, inventory, loader, path, cache=True):
|
||||
@@ -276,7 +277,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable, K8sAnsibleM
|
||||
self.inventory.set_variable(container_name, 'container_state', 'Waiting')
|
||||
self.inventory.set_variable(container_name, 'container_ready', container.ready)
|
||||
self.inventory.set_variable(container_name, 'ansible_remote_tmp', '/tmp/')
|
||||
self.inventory.set_variable(container_name, 'ansible_connection', self.transport)
|
||||
self.inventory.set_variable(container_name, 'ansible_connection', self.connection_plugin)
|
||||
self.inventory.set_variable(container_name, 'ansible_{0}_pod'.format(self.transport),
|
||||
pod_name)
|
||||
self.inventory.set_variable(container_name, 'ansible_{0}_container'.format(self.transport),
|
||||
|
||||
Reference in New Issue
Block a user