mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
VMware: Add check mode support to module vmware_host_service_manager (#46271)
This commit is contained in:
committed by
Abhijeet Kasurde
parent
77127d6768
commit
c4cfeb183f
@@ -83,7 +83,41 @@
|
||||
state: absent
|
||||
register: single_hosts_result
|
||||
|
||||
- name: ensure facts are gathered for all hosts
|
||||
- name: ensure facts are gathered
|
||||
assert:
|
||||
that:
|
||||
- single_hosts_result.changed == False
|
||||
|
||||
- name: Start ntpd service on all hosts in given cluster in check mode
|
||||
vmware_host_service_manager:
|
||||
hostname: "{{ vcsim }}"
|
||||
username: "{{ vcsim_instance.json.username }}"
|
||||
password: "{{ vcsim_instance.json.password }}"
|
||||
validate_certs: no
|
||||
cluster_name: "{{ ccr1 }}"
|
||||
service_name: ntpd
|
||||
state: present
|
||||
register: all_hosts_result_check_mode
|
||||
check_mode: yes
|
||||
|
||||
- name: ensure facts are gathered for all hosts
|
||||
assert:
|
||||
that:
|
||||
- all_hosts_result_check_mode.changed
|
||||
|
||||
- name: Stop ntpd service on a given host in check mode
|
||||
vmware_host_service_manager:
|
||||
hostname: "{{ vcsim }}"
|
||||
username: "{{ vcsim_instance.json.username }}"
|
||||
password: "{{ vcsim_instance.json.password }}"
|
||||
validate_certs: no
|
||||
esxi_hostname: "{{ host1 }}"
|
||||
service_name: ntpd
|
||||
state: absent
|
||||
register: single_hosts_result_check_mode
|
||||
check_mode: yes
|
||||
|
||||
- name: ensure facts are gathered
|
||||
assert:
|
||||
that:
|
||||
- single_hosts_result_check_mode.changed == False
|
||||
|
||||
Reference in New Issue
Block a user