main.yml 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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: install Nvidia driver
  16. yum:
  17. name:
  18. - kmod-nvidia
  19. #- nvidia-x11-drv
  20. state: present
  21. tags: install
  22. #- name: add Nvidia container runtime support
  23. #get_url:
  24. #url: https://nvidia.github.io/nvidia-docker/centos7/nvidia-docker.repo
  25. #dest: /etc/yum.repos.d/nvidia-docker.repo
  26. #tags: install
  27. - name: add Nvidia container runtime support
  28. get_url:
  29. url: https://nvidia.github.io/nvidia-container-runtime/centos7/nvidia-container-runtime.repo
  30. dest: /etc/yum.repos.d/nvidia-container-runtime.repo
  31. tags: install, testing
  32. # disable gpg key (because Nvidia doesn't know how to make that work yet for some reason)
  33. - replace:
  34. path: /etc/yum.repos.d/nvidia-container-runtime.repo
  35. regexp: 'repo_gpgcheck=1'
  36. replace: 'repo_gpgcheck=0'
  37. backup: yes
  38. tags: testing
  39. - name: install Nvidia-container-runtime-hook
  40. yum:
  41. name:
  42. #- nvidia-detect
  43. #- kmod-nvidia-410.73-1.el7_5.elrepo
  44. - nvidia-container-runtime-hook
  45. state: present
  46. tags: install
  47. # This needs to be done on GPU nodes
  48. #- name: Enable DevicePlugins for all GPU nodes (nvidia-container-runtime-hook)
  49. #copy: src=nvidia dest=/usr/libexec/oci/hooks.d/ owner=root group=root mode=755
  50. #tags: install
  51. #- name: Add KUBE_EXTRA_ARGS to enable Plugins (GPU support) --III alreday done in common
  52. #lineinfile:
  53. #path: /etc/systemd/system/kubelet.service.d/10-kubeadm.conf
  54. #line: 'Environment="KUBELET_EXTRA_ARGS=--feature-gates=DevicePlugins=true"'
  55. #insertbefore: 'KUBELET_KUBECONFIG_ARGS='
  56. #tags: install
  57. - name: Restart and Enable docker service
  58. service:
  59. name: docker
  60. state: restarted
  61. enabled: yes
  62. tags: install
  63. - name: Restart and Enable Kubernetes - kubelet
  64. service:
  65. name: kubelet
  66. state: restarted
  67. enabled: yes
  68. tags: install