-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2c761b7
commit 8eab588
Showing
3 changed files
with
56 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
- name: Copy driver to remote host | ||
ansible.builtin.copy: | ||
src: "{{ vgpu_driver_url_components.path }}" | ||
dest: "{{ dir_path }}" | ||
owner: root | ||
group: root | ||
vars: | ||
is_file: "{{ 'file' in vgpu_driver_url_components.scheme }}" | ||
when: is_file | ||
|
||
- name: Install using apt | ||
ansible.builtin.apt: | ||
deb: "{{ dir_path if is_file else vgpu_driver_url }}" | ||
state: present | ||
register: install_result | ||
vars: | ||
is_file: "{{ 'file' in vgpu_driver_url_components.scheme }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
- name: Extract driver | ||
ansible.builtin.unarchive: | ||
src: "{{ vgpu_driver_url_components.path if is_file else vgpu_driver_url }}" | ||
dest: "{{ dir_path }}" | ||
owner: root | ||
group: root | ||
creates: "{{ dir_path }}/Host_Drivers" | ||
remote_src: "{{ omit if is_file else true }}" | ||
vars: | ||
is_file: "{{ 'file' in vgpu_driver_url_components.scheme }}" | ||
|
||
- name: Find .run script | ||
ansible.builtin.find: | ||
paths: "{{ dir_path }}/Host_Drivers" | ||
patterns: "*.run" | ||
register: find_result | ||
|
||
- name: Set execute bit | ||
ansible.builtin.file: | ||
path: "{{ install_script }}" | ||
mode: u+x | ||
|
||
- name: Run the install script | ||
# NOTE: This compiles for currently running kernel, can force with --kernel-name | ||
ansible.builtin.shell: |- | ||
{{ install_script }} -q {% if vgpu_driver_dkms %}--dkms{% endif %} --tmpdir {{ tmp_path }} --ui none --disable-nouveau --no-nouveau-check && touch {{ install_script }}.complete | ||
args: | ||
creates: "{{ omit if vgpu_driver_force_install else install_script ~ '.complete' }}" | ||
environment: | ||
TMPDIR: "{{ tmp_path }}" | ||
register: install_result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters