2017-08-07 18:49:29 +02:00
|
|
|
# Test code for the vcenter license module.
|
2017-11-06 17:28:15 +01:00
|
|
|
# Copyright: (c) 2017, Dag Wieers <dag@wieers.com>
|
|
|
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
2017-08-07 18:49:29 +02:00
|
|
|
|
2019-04-24 19:36:19 +02:00
|
|
|
- when: vcsim is not defined
|
|
|
|
block:
|
|
|
|
- name: Add a vCenter evaluation license
|
|
|
|
vcenter_license: &vcenter_lic_data
|
|
|
|
hostname: "{{ vcenter_hostname }}"
|
|
|
|
username: "{{ vcenter_username }}"
|
|
|
|
password: "{{ vcenter_password }}"
|
|
|
|
validate_certs: no
|
|
|
|
license: 00000-00000-00000-00000-00000
|
|
|
|
state: present
|
|
|
|
|
|
|
|
- name: Remove an (unused) vCenter evaluation license
|
|
|
|
vcenter_license:
|
|
|
|
<<: *vcenter_lic_data
|
|
|
|
state: absent
|
|
|
|
|
|
|
|
- name: Add an invalid vCenter license
|
|
|
|
vcenter_license:
|
|
|
|
<<: *vcenter_lic_data
|
|
|
|
license: 00000-00000-00000-00000-00001
|
|
|
|
state: present
|
|
|
|
register: vcenter_license_output
|
|
|
|
failed_when: '"is not existing or can not be added" not in vcenter_license_output.msg'
|