Commit Graph

7 Commits (9dd548ebb785dcb156d77b9a946b8e377ee2232d)

Author SHA1 Message Date
Gonéri Le Bouder 8d6b9cf6e0 prepare_vmware_tests: add scenario with one ESXi
Add the ability to test with just one vcenter instance and a single
ESXi. This allow us to cover 90 modules.
5 years ago
Gonéri Le Bouder 218f4276d5 vmware_drs_group: creates test vm properly
Creates the test VMs with `prepare_vmware_test`. Before this commit,
only one VM was created and the next step was failing because this was
not matching the expected list of VMs.
5 years ago
Gonéri Le Bouder 964783fbd2 vmware_guest: speed up vmware_guest tests
- Use predictable VM name during the tests (test_vm1, test_vm2 and
  test_vm2). This to simplify the teardown of the newly created resource
  before the next test.
- Update the documentation to explain the new requirement
- Avoid VM creation with `with_items` when it's not mandatory. This to:
    - speed up the test execution, our hypervisors have limited resources
    - simplify the teardown
- Remove `create_d1_c1_f0_env.yml`, the test was just testing how Ansible
  pass environment variables.
- Correct the name for the `f0` variable (`f1`)
- Fix the DVS tests, the hosts can now reach the dvswitch1 vswitch
- Provision the VM with a poweroff status, this to improve the
  idempotency and sleep up the tests
- Avoid the use of `prepare_vmware_tests` to prepare virtual machines
  when we just need one machine
5 years ago
Gonéri Le Bouder 6bb21c3db0 vmware: test-refactoring
- In order to keep the integration with `ansible-test`, we prefer to avoid any
  interaction with the Ansible inventory file.
- split up the prepare_vmware_tests/defaults/main.yml in two
  configuration files: one for vcsim and one for a real environment
- remove all the access to hostvars
- directly interact with the ESXi to mount/umount the datastore
  https://github.com/ansible/ansible/pull/56516
- record the virtual machine folder in the environment configuration
- vmware_guest_move: Use https://github.com/ansible/ansible/pull/55237
5 years ago
Gonéri Le Bouder 2307797a76 vmware: refactoring of vmware test roles -- part3
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
5 years ago
Matt Clay b713246f57 Reduce vcenter integration test boilerplate. 6 years ago
Karsten Jakobsen 8fa01a22a1 VMware: New module vmware_drs_group (#50650)
* Added new vmware module for creating DRS VM or Host groups in a given cluster
* Fixed typo in module name
* Added better docstrings. Fixed better messaging for existing groups. Added delete example.
* Update doc
* Update lib/ansible/modules/cloud/vmware/vmware_drs_group.py
* Updated logic, so result is populated with correct data even if no changes are made
* Update lib/ansible/modules/cloud/vmware/vmware_drs_group.py
* Improved performance by getting group_obj in init()
* Fixed syntax error and added group_name as required if state is
* Added state= to integration test

Co-Authored-By: karstenjakobsen <karsten@karstenjakobsen.dk>
6 years ago