Note: The default ITS GitLab runner is a shared resource and is subject to slowdowns during heavy usage.
You can run your own GitLab runner that is dedicated just to your group if you need to avoid processing delays.

main.yml 1.99 KB
Newer Older
Adam Robinson's avatar
Adam Robinson committed
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
---
# tasks file for VMSA-2019-0011-Workaround
- name: Get the current state of all services
  vmware_host_service_facts:
    hostname: '{{ vcenter_hostname }}'
    esxi_hostname: '{{ inventory_hostname }}'
    username: '{{ vmware_user }}'
    password: '{{ vmware_password }}'
  delegate_to: localhost
  register: host_service_facts

- name: Start SSH Temporarily
  vmware_host_service_manager:
    hostname: '{{ vcenter_hostname }}'
    esxi_hostname: '{{ inventory_hostname }}'
    username: '{{ vmware_user }}'
    password: '{{ vmware_password }}'
    service_name: TSM-SSH
    state: start
  delegate_to: localhost
  when: (ansible_distribution_version == "6.7.0" or ansible_distribution_version == "6.5.0") and not host_service_facts['host_service_facts'][inventory_hostname] | selectattr('key', 'equalto', 'TSM-SSH') | map(attribute='running') | list | first | bool
  notify: Stop SSH

- name: Add ioTrackers to /etc/vmware/hostd/config.xml
  xml:
    backup: yes
    path: /etc/vmware/hostd/config.xml
    xpath: /config/ioTrackers
    value: ' false '
  when: (ansible_distribution_version == "6.7.0" and ansible_distribution_build|int <= 13981272) or (ansible_distribution_version == "6.5.0" and ansible_distribution_build|int < 13932383)
  notify: Restart hostd
  vars:
    ansible_user: '{{ vmware_user }}@{{ ad_domain|upper }}'
    ansible_password: '{{ vmware_password }}'
    ansible_connection: paramiko
    ansible_python_interpreter: /bin/python

- name: Remove ioTrackers from /etc/vmware/hostd/config.xml
  xml:
    backup: yes
    path: /etc/vmware/hostd/config.xml
    xpath: /config/ioTrackers
    state: absent
  when: (ansible_distribution_version == "6.7.0" and ansible_distribution_build|int > 13981272) or (ansible_distribution_version == "6.5.0" and ansible_distribution_build|int >= 13932383)
  notify: Restart hostd
  vars:
    ansible_user: '{{ vmware_user }}@{{ ad_domain|upper }}'
    ansible_password: '{{ vmware_password }}'
    ansible_connection: paramiko
    ansible_python_interpreter: /bin/python