VMware: Add check mode support to module vmware_host_service_manager (#46271)

This commit is contained in:
Christian Kotte
2018-10-08 11:39:38 +02:00
committed by Abhijeet Kasurde
parent 77127d6768
commit c4cfeb183f
2 changed files with 46 additions and 7 deletions

View File

@@ -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