Debian Codegraph @

ansible_collections/community/vmware/tests/integration/targets/vmware_host_hyperthreading/tasks/main.yml

raw
1 # Test code for the vmware_host_hyperthreading module.
2 # Copyright: (c) 2018, Christian Kotte <[email protected]>
3 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
4
5 - import_role:
6 name: prepare_vmware_tests
7 vars:
8 setup_attach_host: true
9
10
11 - name: Enable Hyperthreading everywhere
12 vmware_host_hyperthreading:
13 hostname: "{{ vcenter_hostname }}"
14 username: "{{ vcenter_username }}"
15 password: "{{ vcenter_password }}"
16 validate_certs: false
17 state: disabled
18 register: enable_hyperthreading_everywhere
19 ignore_errors: true
20
21 - when: enable_hyperthreading_everywhere is succeeded
22 block:
23
24 - name: Disable Hyperthreading for a given host
25 vmware_host_hyperthreading:
26 hostname: "{{ vcenter_hostname }}"
27 username: "{{ vcenter_username }}"
28 password: "{{ vcenter_password }}"
29 esxi_hostname: '{{ esxi1 }}'
30 validate_certs: false
31 state: disabled
32 register: host_hyperthreading_info
33
34 - debug: var=host_hyperthreading_info
35
36 - assert:
37 that:
38 - host_hyperthreading_info is defined
39 - host_hyperthreading_info.changed
40
41 - name: Disable Hyperthreading for a given host in check mode
42 vmware_host_hyperthreading:
43 hostname: "{{ vcenter_hostname }}"
44 username: "{{ vcenter_username }}"
45 password: "{{ vcenter_password }}"
46 esxi_hostname: '{{ esxi1 }}'
47 validate_certs: false
48 state: disabled
49 register: host_hyperthreading_info_check_mode
50 check_mode: true
51
52 - debug: var=host_hyperthreading_info_check_mode
53
54 - assert:
55 that:
56 - host_hyperthreading_info_check_mode is defined
57
58 - name: Disable Hyperthreading for all hosts in given cluster
59 vmware_host_hyperthreading:
60 hostname: "{{ vcenter_hostname }}"
61 username: "{{ vcenter_username }}"
62 password: "{{ vcenter_password }}"
63 cluster_name: "{{ ccr1 }}"
64 validate_certs: false
65 state: disabled
66 register: host_hyperthreading_info
67
68 - debug: var=host_hyperthreading_info
69
70 - assert:
71 that:
72 - host_hyperthreading_info is defined
73 - host_hyperthreading_info is changed
74
75 - name: Enable Hyperthreading for all hosts in given cluster in check mode
76 vmware_host_hyperthreading:
77 hostname: "{{ vcenter_hostname }}"
78 username: "{{ vcenter_username }}"
79 password: "{{ vcenter_password }}"
80 cluster_name: "{{ ccr1 }}"
81 validate_certs: false
82 state: enabled
83 register: host_hyperthreading_info_check_mode
84 check_mode: true
85
86 - debug: var=host_hyperthreading_info_check_mode
87
88 - assert:
89 that:
90 - host_hyperthreading_info_check_mode is defined
91 - host_hyperthreading_info_check_mode.changed