Skip to content

Commit 9011b8e

Browse files
authored
Deprecate vmware_host (#2337)
SUMMARY Deprecate community.vmware.vmware_host in favor of vmware.vmware.esxi_host and vmware.vmware.esxi_connection. ISSUE TYPE Feature Pull Request COMPONENT NAME vmware_host ADDITIONAL INFORMATION ansible-collections/vmware.vmware#110 Reviewed-by: mikemorency Reviewed-by: Mario Lenz <m@riolenz.de>
1 parent 1e0ccb7 commit 9011b8e

File tree

14 files changed

+79
-339
lines changed

14 files changed

+79
-339
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
deprecated_features:
2+
- vmware_host - the module has been deprecated and will be removed in community.vmware 7.0.0
3+
(https://github.com/ansible-collections/community.vmware/pull/2337).

meta/runtime.yml

+4
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,10 @@ plugin_routing:
226226
deprecation:
227227
removal_version: 7.0.0
228228
warning_text: Use vmware.vmware.deploy_content_library_template instead.
229+
vmware_host:
230+
deprecation:
231+
removal_version: 7.0.0
232+
warning_text: Use vmware.vmware.esxi_host and vmware.vmware.esxi_connection instead.
229233
vmware_maintenancemode:
230234
deprecation:
231235
removal_version: 7.0.0

plugins/modules/vmware_host.py

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
DOCUMENTATION = r'''
1515
---
1616
module: vmware_host
17+
deprecated:
18+
removed_in: 7.0.0
19+
why: This module has been moved to the L(new vmware.vmware collection,https://forum.ansible.com/t/5880)
20+
alternative: Use M(vmware.vmware.esxi_host) and M(vmware.vmware.esxi_connection) instead.
1721
short_description: Add, remove, or move an ESXi host to, from, or within vCenter
1822
description:
1923
- This module can be used to add, reconnect, or remove an ESXi host to or from vCenter.

tests/integration/targets/prepare_vmware_tests/tasks/init_real_lab.yml

-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
- include_tasks: setup_cluster.yml
1010
- include_tasks: setup_attach_hosts.yml
1111
when: setup_attach_host is defined
12-
- include_tasks: move_host_out_of_cluster.yml
13-
when: move_host_out_of_cluster is defined
1412
- include_tasks: setup_datastore.yml
1513
when: setup_datastore is defined
1614
- include_tasks: setup_virtualmachines.yml

tests/integration/targets/prepare_vmware_tests/tasks/move_host_out_of_cluster.yml

-35
This file was deleted.

tests/integration/targets/prepare_vmware_tests/tasks/setup_attach_hosts.yml

+9-5
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@
33
when: "esxi_hosts|length == 0"
44

55
- name: Add ESXi Hosts to vCenter
6-
vmware_host:
7-
datacenter_name: '{{ dc1 }}'
8-
cluster_name: '{{ ccr1 }}'
9-
esxi_hostname: '{{ item }}'
6+
vmware.vmware.esxi_host:
7+
hostname: '{{ vcenter_hostname }}'
8+
username: '{{ vcenter_username }}'
9+
password: '{{ vcenter_password }}'
10+
datacenter: '{{ dc1 }}'
11+
cluster: '{{ ccr1 }}'
12+
esxi_host_name: '{{ item }}'
1013
esxi_username: '{{ esxi_user }}'
1114
esxi_password: '{{ esxi_password }}'
12-
state: add_or_reconnect
15+
state: present
16+
validate_certs: false
1317
with_items: "{{ esxi_hosts }}"
1418

1519
- name: Disable the Maintenance Mode

tests/integration/targets/vmware_host/aliases

-3
This file was deleted.

tests/integration/targets/vmware_host/tasks/main.yml

-253
This file was deleted.

tests/integration/targets/vmware_host_auto_start/tasks/main.yml

+9-5
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,16 @@
1111
setup_datastore: true
1212

1313
- name: Move the ESXi hosts out of the cluster
14-
vmware_host:
15-
datacenter_name: '{{ dc1 }}'
16-
esxi_hostname: '{{ item }}'
14+
vmware.vmware.esxi_host:
15+
hostname: "{{ vcenter_hostname }}"
16+
username: "{{ vcenter_username }}"
17+
password: "{{ vcenter_password }}"
18+
validate_certs: false
19+
datacenter: "{{ dc1 }}"
20+
folder: '/DC0/host'
21+
esxi_host_name: "{{ item }}"
1722
esxi_username: '{{ esxi_user }}'
1823
esxi_password: '{{ esxi_password }}'
19-
folder: '/DC0/host'
2024
state: present
2125
with_items: "{{ esxi_hosts }}"
2226

@@ -26,7 +30,7 @@
2630
username: "{{ vcenter_username }}"
2731
password: "{{ vcenter_password }}"
2832
validate_certs: false
29-
esxi_host_name: '{{ item }}'
33+
esxi_host_name: "{{ item }}"
3034
enable_maintenance_mode: false
3135
with_items: "{{ esxi_hosts }}"
3236

0 commit comments

Comments
 (0)