main.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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: Install nvidia driver and nvidia-docker2
  21. package:
  22. name: "{{ item }}"
  23. state: present
  24. with_items:
  25. - "{{ nvidia_packages }}"
  26. tags: install
  27. - name: Set nvidia as default runtime
  28. copy:
  29. src: daemon.json
  30. dest: "{{ daemon_file_dest }}"
  31. owner: root
  32. group: root
  33. mode: "{{ daemon_file_mode }}"
  34. tags: install
  35. - name: Restart and enable docker service
  36. service:
  37. name: docker
  38. state: restarted
  39. enabled: yes
  40. daemon_reload: yes
  41. tags: install
  42. - name: Restart and enable kubernetes - kubelet
  43. service:
  44. name: kubelet
  45. state: restarted
  46. enabled: yes
  47. tags: install