mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
2307797a76
Refactoring of the following roles to make use of the new `prepare_vmware_tests` role. - `vmware_drs_group` - `vmware_drs_group_facts` - `vmware_drs_rule_facts` - `vmware_drs_portgroup` - `vmware_drs_portgroup_facts` - `vmware_dvs_portgroup_facts` - `vmware_dvswitch` - `vmware_dvswitch_pvlans` This patch depends on: https://github.com/ansible/ansible/pull/55719 Original PR: https://github.com/ansible/ansible/pull/54882
68 lines
1.9 KiB
YAML
68 lines
1.9 KiB
YAML
---
|
|
- when: vcsim is not defined
|
|
block:
|
|
- include_tasks: teardown.yml
|
|
|
|
- when: vcsim is not defined and setup_esxi_instance is not defined
|
|
block:
|
|
- include_tasks: setup_datacenter.yml
|
|
- include_tasks: setup_cluster.yml
|
|
- include_tasks: setup_attach_hosts.yml
|
|
when: setup_attach_host is defined
|
|
- include_tasks: setup_datastore.yml
|
|
when: setup_datastore is defined
|
|
- include_tasks: setup_virtualmachines.yml
|
|
when: setup_virtualmachines is defined
|
|
- include_tasks: setup_switch.yml
|
|
when: setup_switch is defined
|
|
- include_tasks: setup_dvswitch.yml
|
|
when: setup_dvswitch is defined
|
|
|
|
|
|
- when: vcsim is defined
|
|
block:
|
|
|
|
- name: kill vcsim
|
|
uri:
|
|
url: http://{{ vcsim }}:5000/killall
|
|
|
|
- name: start vcsim (all dressed)
|
|
uri:
|
|
url: http://{{ vcsim }}:5000/spawn?cluster=1&folder=1&ds=2
|
|
register: vcsim_instance
|
|
when: setup_esxi_instance is not defined
|
|
|
|
- name: start vcsim (ESXi only)
|
|
uri:
|
|
url: http://{{ vcsim }}:5000/spawn?esx=1
|
|
register: vcsim_instance
|
|
when: setup_esxi_instance is defined
|
|
|
|
- name: get a list of Hosts from vcsim
|
|
uri:
|
|
url: http://{{ vcsim }}:5000/govc_find?filter=H
|
|
register: vcsim_host_list
|
|
|
|
- name: get a list of Hosts from vcsim
|
|
uri:
|
|
url: http://{{ vcsim }}:5000/govc_find?filter=F
|
|
register: vcsim_host_folder
|
|
- debug: var=vcsim_host_folder
|
|
|
|
- name: add the hosts in the inventory
|
|
add_host:
|
|
hostname: '{{ item | basename }}'
|
|
ansible_host: '{{ item | basename }}'
|
|
ansible_user: 'root'
|
|
ansible_password: 'pass'
|
|
groups:
|
|
- 'esxi-lab'
|
|
with_items: '{{ vcsim_host_list.json }}'
|
|
|
|
- debug:
|
|
var: vcsim_host_list
|
|
|
|
- set_fact:
|
|
vcenter_hostname: "{{ vcsim }}"
|
|
vcenter_username: "user"
|
|
vcenter_password: "pass"
|