-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpre_tasks.yml
64 lines (53 loc) · 2.48 KB
/
pre_tasks.yml
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
---
- block:
- name: Check Ubuntu version
ansible.builtin.pause:
prompt: |
===========================================================================
Unsupported distribution version detected: {{ ansible_distribution }} {{ ansible_distribution_version }}.
Press any key to continue on unsupported Ubuntu version or CTRL+C to abort.
===========================================================================
when: ansible_distribution == 'Ubuntu' and ansible_distribution_version not in ['24.04']
- name: Determine XDG_DATA_HOME value for current installation
ansible.builtin.set_fact:
xdg_data_home: "{{ lookup('env', 'XDG_DATA_HOME') | default(ansible_env.HOME + '/.local/share', true) }}"
- name: Determine XDG_CONFIG_HOME value for current installation
ansible.builtin.set_fact:
xdg_config_home: "{{ lookup('env', 'XDG_CONFIG_HOME') | default(ansible_env.HOME + '/.config', true) }}"
- name: Determine XDG_STATE_HOME value for current installation
ansible.builtin.set_fact:
xdg_state_home: "{{ lookup('env', 'XDG_STATE_HOME') | default(ansible_env.HOME + '/.local/state', true) }}"
- name: Check for AMD GPU presence
ansible.builtin.shell:
cmd: "lspci | grep -i 'vga' | grep -i 'amd'"
executable: /bin/bash
register: lspci_output_amd
ignore_errors: true
changed_when: false
failed_when: false
- name: Set has_amd_gpu fact based on lspci output
ansible.builtin.set_fact:
has_amd_gpu: "{{ 'true' if lspci_output_amd.stdout != '' else 'false' }}"
- name: Check for Intel GPU presence
ansible.builtin.shell:
cmd: "lspci | grep -i 'vga' | grep -i 'intel'"
executable: /bin/bash
register: lspci_output_intel
ignore_errors: true
changed_when: false
failed_when: false
- name: Set has_intel_gpu fact based on lspci output
ansible.builtin.set_fact:
has_intel_gpu: "{{ 'true' if lspci_output_intel.stdout != '' else 'false' }}"
- name: Check for NVIDIA GPU presence
ansible.builtin.shell:
cmd: "lspci | grep -i 'vga' | grep -i 'nvidia'"
executable: /bin/bash
register: lspci_output
ignore_errors: true
changed_when: false
failed_when: false
- name: Set has_nvidia_gpu fact based on lspci output
ansible.builtin.set_fact:
has_nvidia_gpu: "{{ 'true' if lspci_output.stdout != '' else 'false' }}"
tags: always