Skip to content

Commit

Permalink
prepapre_vmware_tests: add a common vars file
Browse files Browse the repository at this point in the history
Add a new file to record the variables that are shared with the two
scenarios (real_lab and vcsim).

The goal is to reduce the the amount of boilerplate configuration from
a user perspective.
  • Loading branch information
goneri committed Jun 21, 2019
1 parent 927c59f commit db81b1d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 27 deletions.
9 changes: 7 additions & 2 deletions test/integration/targets/prepare_vmware_tests/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
---

- name: load vmware common vars
include_vars:
file: common.yml

- when: vcsim is not defined
import_tasks: init_real_lab.yml
include_tasks: init_real_lab.yml

- when: vcsim is defined
import_tasks: init_vcsim.yml
include_tasks: init_vcsim.yml
12 changes: 12 additions & 0 deletions test/integration/targets/prepare_vmware_tests/vars/common.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
dc1: DC0
ccr1: DC0_C0
ds1: LocalDS_0
ds2: LocalDS_1
f0: F0
switch1: switch1
esxi1: '{{ esxi_hosts[0] }}'
esxi2: '{{ esxi_hosts[1] }}'
esxi3: '{{ esxi_hosts[2] }}'
dvswitch1: DVS0
esxi_user: root
16 changes: 1 addition & 15 deletions test/integration/targets/prepare_vmware_tests/vars/real_lab.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,8 @@
---
dc1: DC0
ccr1: DC0_C0
ds1: LocalDS_0
ds2: LocalDS_1
f0: F0
switch1: switch1
dvswitch1: DVS0
# The ESXi entries in the inventory
vcenter_hostname: vcenter.test
vcenter_username: administrator@vsphere.local
vcenter_password: blablabla
esxi_hosts:
- esxi1.test
- esxi2.test
esxi_user: root
esxi_password: balbalbla
esxi1: "{{ esxi_hosts[0] }}"
esxi2: "{{ esxi_hosts[1] }}"
esxi_password: '{{ esxi1_password }}'
infra:
datastores:
LocalDS_0:
Expand Down
10 changes: 0 additions & 10 deletions test/integration/targets/prepare_vmware_tests/vars/vcsim.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
---
dc1: DC0
ccr1: DC0_C0
ds1: LocalDS_0
ds2: LocalDS_1
f0: F0
esxi_hosts:
- DC0_C0_H0
- DC0_C0_H1
- DC0_C0_H2
esxi1: '{{ esxi_hosts[0] }}'
esxi2: '{{ esxi_hosts[1] }}'
esxi3: '{{ esxi_hosts[2] }}'
switch1: switch1
dvswitch1: DVS0
virtual_machines:
- name: DC0_H0_VM0
folder: /F0/DC0/vm/F0
Expand Down

0 comments on commit db81b1d

Please sign in to comment.