diff --git a/tasks/createcdi.service.j2 b/tasks/createcdi.service.j2 new file mode 100644 index 0000000..3ba9d9c --- /dev/null +++ b/tasks/createcdi.service.j2 @@ -0,0 +1,9 @@ +[Unit] +Description=Rebuild cdi on boot + +[Service] +Type=oneshot +ExecStart=/usr/bin/nvidia-ctk cdi generate --output=/etc/cdi/nvidia.yaml + +[Install] +WantedBy=multi-user.target diff --git a/tasks/main.yaml b/tasks/main.yaml index 7f94923..9f4c244 100644 --- a/tasks/main.yaml +++ b/tasks/main.yaml @@ -46,6 +46,20 @@ args: creates: /etc/cdi/nvidia.yaml + - name: Create systemd unit file + template: + src: createcdi.service.j2 + dest: /etc/systemd/system/createcdi.service + owner: root + group: root + mode: '0644' + + - name: libnvidia-container | automatically regenerate cdi + systemd: + name: createcdi + enabled: yes + state: started + - name: Install podman apt: name: [ 'podman', 'podman-compose' ]