main.yml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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: https://nvidia.github.io/nvidia-docker/centos7/nvidia-docker.repo
  18. dest: /etc/yum.repos.d/nvidia-docker.repo
  19. tags: install, testing
  20. - name: install Nvidia driver and nvidia-docker2
  21. package:
  22. name:
  23. - kmod-nvidia
  24. - nvidia-docker2
  25. state: present
  26. tags: install
  27. - name: Set nvidia as default runtime
  28. copy: src=daemon.json dest=/etc/docker/ owner=root group=root mode=644
  29. tags: install
  30. - name: Restart and Enable docker service
  31. service:
  32. name: docker
  33. state: restarted
  34. enabled: yes
  35. tags: install
  36. - name: Restart and Enable Kubernetes - kubelet
  37. service:
  38. name: kubelet
  39. state: restarted
  40. enabled: yes
  41. tags: install