nvidia.yml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. # Copyright 2020 Dell Inc. or its subsidiaries. All Rights Reserved.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. ---
  15. - name: Add nvidia-docker2 Repo
  16. get_url:
  17. url: "{{ nvidia_docker_repo_url }}"
  18. dest: "{{ nvidia_docker_repo_dest }}"
  19. tags: install, testing
  20. - name: Add libnvidia container Repo
  21. get_url:
  22. url: "{{ nvidia_container_repo_url }}"
  23. dest: "{{ nvidia_container_repo_dest }}"
  24. tags: install, testing
  25. - name: Install nvidia driver and nvidia-docker2
  26. package:
  27. name: "{{ nvidia_packages }}"
  28. enablerepo: libnvidia-container,nvidia-docker
  29. state: present
  30. tags: install
  31. - name: Reboot after installing GPU drivers
  32. reboot:
  33. tags: install
  34. - name: Set nvidia as default runtime
  35. copy:
  36. src: daemon.json
  37. dest: "{{ daemon_file_dest }}"
  38. owner: root
  39. group: root
  40. mode: "{{ daemon_file_mode }}"
  41. tags: install
  42. - name: Restart and enable docker service
  43. service:
  44. name: docker
  45. state: restarted
  46. enabled: yes
  47. daemon_reload: yes
  48. tags: install
  49. - name: Restart and enable kubernetes - kubelet
  50. service:
  51. name: kubelet
  52. state: restarted
  53. enabled: yes
  54. tags: install