Skip to content

Commit

Permalink
VMware: Add check mode support to vmware_vmkernel_facts (ansible#47286)
Browse files Browse the repository at this point in the history
  • Loading branch information
ckotte authored and Tomorrow9 committed Dec 4, 2018
1 parent d6f402e commit bc6b10b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/ansible/modules/cloud/vmware/vmware_vmkernel_facts.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ def main():
argument_spec=argument_spec,
required_one_of=[
['cluster_name', 'esxi_hostname'],
]
],
supports_check_mode=True
)

vmware_vmk_config = VmkernelFactsManager(module)
Expand Down
18 changes: 17 additions & 1 deletion test/integration/targets/vmware_vmkernel_facts/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

- debug: var=host1

- name: Gather VNICs facts about all hosts in given cluster
- name: Gather VMkernel facts about all hosts in given cluster
vmware_vmkernel_facts:
hostname: "{{ vcsim }}"
username: "{{ user }}"
Expand All @@ -59,3 +59,19 @@
- assert:
that:
- host_vmkernel.host_vmk_facts is defined

- name: Gather VMkernel facts about all hosts in given cluster in check mode
vmware_vmkernel_facts:
hostname: "{{ vcsim }}"
username: "{{ user }}"
password: "{{ passwd }}"
esxi_hostname: "{{ host1 }}"
validate_certs: no
register: host_vmkernel_check_mode
check_mode: yes

- debug: var=host_vmkernel

- assert:
that:
- host_vmkernel_check_mode.host_vmk_facts is defined

0 comments on commit bc6b10b

Please sign in to comment.