summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/vcenter_license/tasks/main.yml
blob: f57d3a5c160c1fb2f55366fb60095203d7a6bfbe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Test code for the vcenter license module.
# 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)

- 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'