Skip to content

Commit af13893

Browse files
authored
Deprecate vmware_maintenancemode (#2293)
SUMMARY Deprecate community.vmware.vmware_maintenancemode in favor of vmware.vmware.esxi_maintenance_mode. ISSUE TYPE Feature Pull Request COMPONENT NAME vmware_maintenancemode ADDITIONAL INFORMATION ansible-collections/vmware.vmware#99
1 parent 078cedd commit af13893

File tree

11 files changed

+52
-104
lines changed

11 files changed

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

galaxy.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ tags:
1818
- vmware
1919
- virtualization
2020
dependencies:
21-
vmware.vmware: ">=1.5.0,<2.0.0"
21+
vmware.vmware: ">=1.9.0,<2.0.0"
2222
repository: https://github.com/ansible-collections/community.vmware.git
2323
homepage: https://github.com/ansible-collections/community.vmware
2424
issues: https://github.com/ansible-collections/community.vmware/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc

meta/runtime.yml

+4
Original file line numberDiff line numberDiff line change
@@ -214,3 +214,7 @@ plugin_routing:
214214
deprecation:
215215
removal_version: 6.0.0
216216
warning_text: Use vmware.vmware.cluster_vcls instead.
217+
vmware_maintenancemode:
218+
deprecation:
219+
removal_version: 7.0.0
220+
warning_text: Use vmware.vmware.esxi_maintenance_mode instead.

plugins/modules/vmware_maintenancemode.py

+4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
DOCUMENTATION = r'''
1414
---
1515
module: vmware_maintenancemode
16+
deprecated:
17+
removed_in: 7.0.0
18+
why: This module has been moved to the L(new vmware.vmware collection,https://forum.ansible.com/t/5880)
19+
alternative: Use M(vmware.vmware.esxi_maintenance_mode) instead.
1620
short_description: Place a host into maintenance mode
1721
description:
1822
- This module can be used for placing a ESXi host into maintenance mode.

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
22
- name: Enter maintenance mode
3-
vmware_maintenancemode:
3+
vmware.vmware.esxi_maintenance_mode:
44
hostname: "{{ vcenter_hostname }}"
55
username: "{{ vcenter_username }}"
66
password: "{{ vcenter_password }}"
77
validate_certs: false
8-
esxi_hostname: "{{ item }}"
9-
state: present
8+
esxi_host_name: "{{ item }}"
9+
enable_maintenance_mode: true
1010
with_items: "{{ esxi_hosts }}"
1111
ignore_errors: true
1212

@@ -24,12 +24,12 @@
2424
ignore_errors: true
2525

2626
- name: Exit maintenance mode
27-
vmware_maintenancemode:
27+
vmware.vmware.esxi_maintenance_mode:
2828
hostname: "{{ vcenter_hostname }}"
2929
username: "{{ vcenter_username }}"
3030
password: "{{ vcenter_password }}"
3131
validate_certs: false
32-
esxi_hostname: "{{ item }}"
33-
state: absent
32+
esxi_host_name: "{{ item }}"
33+
enable_maintenance_mode: false
3434
with_items: "{{ esxi_hosts }}"
3535
ignore_errors: true

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

+7-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,13 @@
1313
with_items: "{{ esxi_hosts }}"
1414

1515
- name: Disable the Maintenance Mode
16-
vmware_maintenancemode:
17-
esxi_hostname: '{{ item }}'
18-
state: absent
16+
vmware.vmware.esxi_maintenance_mode:
17+
hostname: "{{ vcenter_hostname }}"
18+
username: "{{ vcenter_username }}"
19+
password: "{{ vcenter_password }}"
20+
validate_certs: false
21+
esxi_host_name: '{{ item }}'
22+
enable_maintenance_mode: false
1923
with_items: "{{ esxi_hosts }}"
2024

2125
# A bit of explanation here. Our test VMs will produce some ARP traffic,

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

+7-3
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,13 @@
2121
with_items: "{{ esxi_hosts }}"
2222

2323
- name: Disable the Maintenance Mode
24-
vmware_maintenancemode:
25-
esxi_hostname: '{{ item }}'
26-
state: absent
24+
vmware.vmware.esxi_maintenance_mode:
25+
hostname: "{{ vcenter_hostname }}"
26+
username: "{{ vcenter_username }}"
27+
password: "{{ vcenter_password }}"
28+
validate_certs: false
29+
esxi_host_name: '{{ item }}'
30+
enable_maintenance_mode: false
2731
with_items: "{{ esxi_hosts }}"
2832

2933
- name: Create VM on esxi1

tests/integration/targets/vmware_maintenancemode/aliases

-3
This file was deleted.

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

-76
This file was deleted.

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,13 @@
231231
block:
232232
# Remove ESXi host from cluster for tests
233233
- name: Enter maintenance mode
234-
vmware_maintenancemode:
234+
vmware.vmware.esxi_maintenance_mode:
235235
hostname: "{{ vcenter_hostname }}"
236236
username: "{{ vcenter_username }}"
237237
password: "{{ vcenter_password }}"
238238
validate_certs: false
239-
esxi_hostname: "{{ esxi2 }}"
240-
state: present
239+
esxi_host_name: "{{ esxi2 }}"
240+
enable_maintenance_mode: true
241241

242242
- name: Move ESXi out of Cluster
243243
vmware_host:
@@ -251,13 +251,13 @@
251251
state: reconnect
252252

253253
- name: Exit maintenance mode
254-
vmware_maintenancemode:
254+
vmware.vmware.esxi_maintenance_mode:
255255
hostname: "{{ vcenter_hostname }}"
256256
username: "{{ vcenter_username }}"
257257
password: "{{ vcenter_password }}"
258258
validate_certs: false
259-
esxi_hostname: "{{ esxi2 }}"
260-
state: absent
259+
esxi_host_name: "{{ esxi2 }}"
260+
enable_maintenance_mode: false
261261

262262
- name: add resource pool to ESXi with check_mode
263263
vmware_resource_pool:

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

+14-6
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,13 @@
2020
with_items: '{{ esxi_hosts }}'
2121

2222
- name: Disable the Maintenance Mode
23-
vmware_maintenancemode:
24-
esxi_hostname: '{{ item }}'
25-
state: absent
23+
vmware.vmware.esxi_maintenance_mode:
24+
hostname: '{{ vcenter_hostname }}'
25+
username: '{{ vcenter_username }}'
26+
password: '{{ vcenter_password }}'
27+
validate_certs: false
28+
esxi_host_name: '{{ item }}'
29+
enable_maintenance_mode: false
2630
with_items: '{{ esxi_hosts }}'
2731

2832
- name: Create VM
@@ -91,9 +95,13 @@
9195
with_items: '{{ esxi_hosts }}'
9296

9397
- name: Disable the Maintenance Mode
94-
vmware_maintenancemode:
95-
esxi_hostname: '{{ item }}'
96-
state: absent
98+
vmware.vmware.esxi_maintenance_mode:
99+
hostname: '{{ vcenter_hostname }}'
100+
username: '{{ vcenter_username }}'
101+
password: '{{ vcenter_password }}'
102+
validate_certs: false
103+
esxi_host_name: '{{ item }}'
104+
enable_maintenance_mode: false
97105
with_items: '{{ esxi_hosts }}'
98106

99107
- name: Perform vMotion of virtual machine to resource_pool

0 commit comments

Comments
 (0)