main.yml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 container runtime support
  16. get_url:
  17. url: https://nvidia.github.io/nvidia-container-runtime/centos7/nvidia-container-runtime.repo
  18. dest: /etc/yum.repos.d/nvidia-container-runtime.repo
  19. tags: install, testing
  20. - name: disable gpg key for nvidia-container-runtime
  21. replace:
  22. path: /etc/yum.repos.d/nvidia-container-runtime.repo
  23. regexp: 'repo_gpgcheck=1'
  24. replace: 'repo_gpgcheck=0'
  25. backup: yes
  26. tags: install
  27. - name: install Nvidia-container-runtime-hook
  28. package:
  29. name:
  30. - kmod-nvidia
  31. - nvidia-container-runtime-hook
  32. - nvidia-docker2
  33. state: present
  34. tags: install
  35. - name: Set nvidia as default runtime
  36. copy: src=daemon.json dest=/etc/docker/ owner=root group=root mode=644
  37. tags: install
  38. - name: Restart and Enable docker service
  39. service:
  40. name: docker
  41. state: restarted
  42. enabled: yes
  43. tags: install
  44. - name: Restart and Enable Kubernetes - kubelet
  45. service:
  46. name: kubelet
  47. state: restarted
  48. enabled: yes
  49. tags: install