mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 05:10:22 -07:00
Add esxi_hostname as argument in vmware_vswitch (#30498)
Fix adds esxi_hostname as Ansible module argument for user to define ESXi hostname to deploy VMware vSwitch. Fixes: #24647 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
parent
f5a2e26ffd
commit
e4254da1b1
2 changed files with 68 additions and 18 deletions
|
@ -126,3 +126,31 @@
|
|||
#- assert:
|
||||
# that:
|
||||
# - remove_nic_again_run.changed == false
|
||||
|
||||
|
||||
- name: get a list of Host Systems from vcsim
|
||||
uri:
|
||||
url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=H' }}"
|
||||
register: host_systems
|
||||
|
||||
- name: get a host system
|
||||
set_fact: hs1="{{ host_systems['json'][0] | basename }}"
|
||||
|
||||
- debug: var=hs1
|
||||
|
||||
- name: Add vswitch to a specific host system
|
||||
vmware_vswitch:
|
||||
validate_certs: False
|
||||
hostname: "{{ vcsim }}"
|
||||
username: "{{ vcsim_instance['json']['username'] }}"
|
||||
password: "{{ vcsim_instance['json']['password'] }}"
|
||||
switch: vmswitch_0002
|
||||
nics: vnic_1
|
||||
esxi_hostname: hs1
|
||||
register: add_vswitch_with_host_system
|
||||
|
||||
- debug: var=add_vswitch_with_host_system
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- add_vswitch_with_host_system.changed == true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue