From b0c2f6f29b5fafc94132f46e484321c97121e4f8 Mon Sep 17 00:00:00 2001 From: Douglas Holt Date: Mon, 15 Jul 2019 14:39:29 -0700 Subject: [PATCH] Add method for setting driver module parameters --- defaults/main.yml | 2 ++ tasks/main.yml | 6 ++++++ templates/nvidia.conf.j2 | 1 + 3 files changed, 9 insertions(+) create mode 100644 templates/nvidia.conf.j2 diff --git a/defaults/main.yml b/defaults/main.yml index 5c8b0b4..528d531 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -2,6 +2,8 @@ nvidia_driver_package_state: present nvidia_driver_package_version: '' nvidia_driver_persistence_mode_on: yes nvidia_driver_skip_reboot: no +nvidia_driver_module_file: /etc/modprobe.d/nvidia.conf +nvidia_driver_module_params: '' # RedHat family nvidia_driver_rhel_epel_repo_baseurl: "https://download.fedoraproject.org/pub/epel/$releasever/$basearch/" diff --git a/tasks/main.yml b/tasks/main.yml index cc7da24..9ab9c4f 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -37,6 +37,12 @@ enabled: yes when: nvidia_driver_package_state != 'absent' +- name: set module parameters + template: + src: nvidia.conf.j2 + dest: "{{ nvidia_driver_module_file }}" + mode: '0644' + - name: reboot after driver install reboot: when: install_driver.changed and not nvidia_driver_skip_reboot diff --git a/templates/nvidia.conf.j2 b/templates/nvidia.conf.j2 new file mode 100644 index 0000000..b7b6654 --- /dev/null +++ b/templates/nvidia.conf.j2 @@ -0,0 +1 @@ +{{ nvidia_driver_module_params }}