Skip to content

Commit 8506307

Browse files
Merge pull request #686 from bogdando/nova02beta
nova02: Fix install nvidia driver w/o trusted crt and casting pci address as a string Fix install nvidia driver w/o trusted crt For http:// or https:// URLs: Download the RPM with get_url and validate_certs: false to /tmp/.rpm on the target host. Set nvidia_rpm_install_path to that local path for HTTP(S), or to the original value for file:// or local paths. Install with dnf using nvidia_rpm_install_path (local file or path), so no HTTPS is done by dnf. NOTE: eventually, we should switch to edpm accel driver role, but it needs to be shipped with rhoso to be consumed directly here do not convert from YAML nvidia_pci_address ...because it will be translated into wrong (datatime) value. Reviewed-by: Andrew Bays <andrew.bays@gmail.com>
2 parents 0ac5623 + ea04d13 commit 8506307

File tree

2 files changed

+35
-5
lines changed

2 files changed

+35
-5
lines changed

dt/nova/nova02beta/edpm/nodeset/nova_sriov.yaml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,24 @@ spec:
7777
- name: Gather the package facts
7878
ansible.builtin.package_facts:
7979
manager: auto
80+
- name: Download NVIDIA driver RPM from URL (skip SSL verify for internal servers)
81+
become: true
82+
ansible.builtin.get_url:
83+
url: "{{ nvidia_rpm_url }}"
84+
dest: "/tmp/{{ nvidia_rpm_url.split('/')[-1] }}"
85+
validate_certs: false
86+
when:
87+
- nvidia_rpm_url not in ansible_facts.packages
88+
- nvidia_rpm_url is match('^https?://')
89+
register: _nvidia_rpm_download
90+
- name: Set NVIDIA RPM install path (local file after download or original URL/path)
91+
ansible.builtin.set_fact:
92+
nvidia_rpm_install_path: "{{ ('/tmp/' + nvidia_rpm_url.split('/')[-1]) if nvidia_rpm_url is match('^https?://') else nvidia_rpm_url }}"
93+
when: nvidia_rpm_url not in ansible_facts.packages
8094
- name: Install nvidia driver RPM either from path or URL
8195
become: true
8296
ansible.builtin.dnf:
83-
name: "{{ nvidia_rpm_url }}"
97+
name: "{{ nvidia_rpm_install_path }}"
8498
state: present
8599
disable_gpg_check: true
86100
when: nvidia_rpm_url not in ansible_facts.packages

dt/nova/nova02beta/edpm/nodeset2/nova_sriov.yaml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,20 +113,36 @@ spec:
113113
- "/tmp/nvidia-sriov.pp"
114114
when: policy_file.changed
115115
116-
- name: Get the Nvidia Driver URL
116+
- name: Load NVIDIA config from controller mount
117117
delegate_to: localhost
118118
ansible.builtin.set_fact:
119-
nvidia_rpm_url: "{{ lookup('file', '/var/lib/openstack/configs/install-nvidia-sriov/nvidia_driver_url') | from_yaml }}"
120-
nvidia_pci_address: "{{ lookup('file', '/var/lib/openstack/configs/install-nvidia-sriov/nvidia_pci_address') | from_yaml }}"
119+
nvidia_rpm_url: "{{ lookup('file', '/var/lib/openstack/configs/install-nvidia-sriov/nvidia_driver_url') | from_yaml | trim }}"
120+
nvidia_pci_address: "{{ lookup('file', '/var/lib/openstack/configs/install-nvidia-sriov/nvidia_pci_address') | trim }}"
121121
122122
- name: Gather the package facts
123123
ansible.builtin.package_facts:
124124
manager: auto
125125
126+
- name: Download NVIDIA driver RPM from URL (skip SSL verify for internal servers)
127+
become: true
128+
ansible.builtin.get_url:
129+
url: "{{ nvidia_rpm_url }}"
130+
dest: "/tmp/{{ nvidia_rpm_url.split('/')[-1] }}"
131+
validate_certs: false
132+
when:
133+
- nvidia_rpm_url not in ansible_facts.packages
134+
- nvidia_rpm_url is match('^https?://')
135+
register: _nvidia_rpm_download
136+
137+
- name: Set NVIDIA RPM install path (local file after download or original URL/path)
138+
ansible.builtin.set_fact:
139+
nvidia_rpm_install_path: "{{ ('/tmp/' + nvidia_rpm_url.split('/')[-1]) if nvidia_rpm_url is match('^https?://') else nvidia_rpm_url }}"
140+
when: nvidia_rpm_url not in ansible_facts.packages
141+
126142
- name: Install nvidia driver RPM either from path or URL
127143
become: true
128144
ansible.builtin.dnf:
129-
name: "{{ nvidia_rpm_url }}"
145+
name: "{{ nvidia_rpm_install_path }}"
130146
state: present
131147
disable_gpg_check: true
132148
when: nvidia_rpm_url not in ansible_facts.packages

0 commit comments

Comments
 (0)