Skip to content

Commit

Permalink
Deprecate vmware_host (#2337)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mariolenz authored Mar 3, 2025
1 parent 1e0ccb7 commit 9011b8e
Show file tree
Hide file tree
Showing 14 changed files with 79 additions and 339 deletions.
3 changes: 3 additions & 0 deletions changelogs/fragments/2337-deprecate-vmware_host.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
deprecated_features:
- vmware_host - the module has been deprecated and will be removed in community.vmware 7.0.0
(https://github.com/ansible-collections/community.vmware/pull/2337).
4 changes: 4 additions & 0 deletions meta/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,10 @@ plugin_routing:
deprecation:
removal_version: 7.0.0
warning_text: Use vmware.vmware.deploy_content_library_template instead.
vmware_host:
deprecation:
removal_version: 7.0.0
warning_text: Use vmware.vmware.esxi_host and vmware.vmware.esxi_connection instead.
vmware_maintenancemode:
deprecation:
removal_version: 7.0.0
Expand Down
4 changes: 4 additions & 0 deletions plugins/modules/vmware_host.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
DOCUMENTATION = r'''
---
module: vmware_host
deprecated:
removed_in: 7.0.0
why: This module has been moved to the L(new vmware.vmware collection,https://forum.ansible.com/t/5880)
alternative: Use M(vmware.vmware.esxi_host) and M(vmware.vmware.esxi_connection) instead.
short_description: Add, remove, or move an ESXi host to, from, or within vCenter
description:
- This module can be used to add, reconnect, or remove an ESXi host to or from vCenter.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
- include_tasks: setup_cluster.yml
- include_tasks: setup_attach_hosts.yml
when: setup_attach_host is defined
- include_tasks: move_host_out_of_cluster.yml
when: move_host_out_of_cluster is defined
- include_tasks: setup_datastore.yml
when: setup_datastore is defined
- include_tasks: setup_virtualmachines.yml
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@
when: "esxi_hosts|length == 0"

- name: Add ESXi Hosts to vCenter
vmware_host:
datacenter_name: '{{ dc1 }}'
cluster_name: '{{ ccr1 }}'
esxi_hostname: '{{ item }}'
vmware.vmware.esxi_host:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
datacenter: '{{ dc1 }}'
cluster: '{{ ccr1 }}'
esxi_host_name: '{{ item }}'
esxi_username: '{{ esxi_user }}'
esxi_password: '{{ esxi_password }}'
state: add_or_reconnect
state: present
validate_certs: false
with_items: "{{ esxi_hosts }}"

- name: Disable the Maintenance Mode
Expand Down
3 changes: 0 additions & 3 deletions tests/integration/targets/vmware_host/aliases

This file was deleted.

253 changes: 0 additions & 253 deletions tests/integration/targets/vmware_host/tasks/main.yml

This file was deleted.

14 changes: 9 additions & 5 deletions tests/integration/targets/vmware_host_auto_start/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@
setup_datastore: true

- name: Move the ESXi hosts out of the cluster
vmware_host:
datacenter_name: '{{ dc1 }}'
esxi_hostname: '{{ item }}'
vmware.vmware.esxi_host:
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
validate_certs: false
datacenter: "{{ dc1 }}"
folder: '/DC0/host'
esxi_host_name: "{{ item }}"
esxi_username: '{{ esxi_user }}'
esxi_password: '{{ esxi_password }}'
folder: '/DC0/host'
state: present
with_items: "{{ esxi_hosts }}"

Expand All @@ -26,7 +30,7 @@
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
validate_certs: false
esxi_host_name: '{{ item }}'
esxi_host_name: "{{ item }}"
enable_maintenance_mode: false
with_items: "{{ esxi_hosts }}"

Expand Down
Loading

0 comments on commit 9011b8e

Please sign in to comment.