mirror of
https://github.com/kubevirt/kubevirt.core.git
synced 2026-05-08 22:32:58 +00:00
feat: Set ansible_connection to winrm for Windows hosts
This changes the inventory plugin so that it sets the ansible_connection to winrm if it detected a Windows host. If it did not detect a Windows host the ansible_connection is no longer set, so Ansible falls back to its default value of ssh. The detection of SSH services for hosts using winrm is disabled. Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
This commit is contained in:
20
tests/unit/utils/merge_dicts.py
Normal file
20
tests/unit/utils/merge_dicts.py
Normal file
@@ -0,0 +1,20 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2024 Red Hat, Inc.
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
from __future__ import absolute_import, division, print_function
|
||||
|
||||
__metaclass__ = type
|
||||
|
||||
from copy import deepcopy
|
||||
|
||||
|
||||
def merge_dicts(dict1, dict2):
|
||||
merged = deepcopy(dict1)
|
||||
for key, value in dict2.items():
|
||||
if key in merged and isinstance(merged[key], dict) and isinstance(value, dict):
|
||||
merged[key] = merge_dicts(merged[key], value)
|
||||
else:
|
||||
merged[key] = value
|
||||
|
||||
return merged
|
||||
Reference in New Issue
Block a user