1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

VMware: Add check mode support to module vmware_host_firewall_facts (#46265)

This commit is contained in:
Christian Kotte 2018-10-04 12:28:53 +02:00 committed by Abhijeet Kasurde
parent ab26119637
commit a4961ff32a
2 changed files with 32 additions and 1 deletions

View file

@ -143,7 +143,8 @@ def main():
argument_spec=argument_spec,
required_one_of=[
['cluster_name', 'esxi_hostname'],
]
],
supports_check_mode=True
)
vmware_host_firewall = FirewallFactsManager(module)

View file

@ -80,3 +80,33 @@
that:
- "not firewall_0002_results.changed"
- "firewall_0002_results.hosts_firewall_facts is defined"
- name: Gather firewall facts for all ESXi host from given cluster in check mode
vmware_host_firewall_facts:
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance.json.username }}"
password: "{{ vcsim_instance.json.password }}"
validate_certs: no
cluster_name: "{{ ccr1 }}"
register: firewall_0003_results
check_mode: yes
- assert:
that:
- "not firewall_0003_results.changed"
- "firewall_0003_results.hosts_firewall_facts is defined"
- name: Gather firewall facts for ESXi host in check mode
vmware_host_firewall_facts:
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance.json.username }}"
password: "{{ vcsim_instance.json.password }}"
validate_certs: no
esxi_hostname: "{{ host1 }}"
register: firewall_0004_results
check_mode: yes
- assert:
that:
- "not firewall_0004_results.changed"
- "firewall_0004_results.hosts_firewall_facts is defined"