VMware: Add check mode support to module vmware_host_firewall_facts (#46265)
This commit is contained in:
parent
ab26119637
commit
a4961ff32a
2 changed files with 32 additions and 1 deletions
|
@ -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)
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue