Skip to content

Commit 884d87e

Browse files
authored
Use temporary directory under /opt (#4)
This prevents issues with the nvidia installer when /tmp has the noexec option set (As recommended in some security hardening guides).
1 parent b4213e8 commit 884d87e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

roles/vgpu/tasks/install.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,11 @@
4848
- name: Run the install script
4949
# NOTE: This compiles for currently running kernel, can force with --kernel-name
5050
shell: |-
51-
{{ install_script }} -q {% if vgpu_driver_dkms %}--dkms{% endif %} --ui none --disable-nouveau --no-nouveau-check && touch {{ install_script }}.complete
51+
{{ install_script }} -q {% if vgpu_driver_dkms %}--dkms{% endif %} --tmpdir {{ tmp_path }} --ui none --disable-nouveau --no-nouveau-check && touch {{ install_script }}.complete
5252
args:
5353
creates: "{{ omit if vgpu_driver_force_install else install_script ~ '.complete' }}"
54+
environment:
55+
TMPDIR: "{{ tmp_path }}"
5456
register: install_result
5557

5658
- name: Reboot after driver install
@@ -62,6 +64,7 @@
6264
vars:
6365
vgpu_driver_url_components: "{{ vgpu_driver_url | urlsplit }}"
6466
dir_path: "/opt/{{ filename | splitext | first }}"
67+
tmp_path: "{{ dir_path }}/tmp"
6568
filename: "{{ vgpu_driver_url_components.path | basename }}"
6669
install_script: "{{ find_result.files.0.path }}"
6770
ansible_become: true

0 commit comments

Comments
 (0)