main.yml 888 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. ---
  2. - block:
  3. - name: ensure gpu init dir exists
  4. file:
  5. path: "{{ item }}"
  6. state: directory
  7. become: yes
  8. loop:
  9. - /usr/local/gpu-init
  10. - /usr/share/hwdata
  11. - name: Update pciids
  12. become: yes
  13. copy:
  14. src: pci.ids
  15. dest: /usr/share/hwdata/pci.ids
  16. owner: root
  17. group: root
  18. mode: 0644
  19. - name: cp gpu related files
  20. become: yes
  21. copy:
  22. src: "{{ item }}"
  23. dest: /usr/local/gpu-init/
  24. owner: root
  25. group: root
  26. mode: preserve
  27. loop:
  28. - functions
  29. - gpu_setup.sh
  30. - name: init gpus
  31. shell: bash /usr/local/gpu-init/gpu_setup.sh >/dev/null 2>&1
  32. args:
  33. executable: /bin/bash
  34. chdir: /usr/local/gpu-init/
  35. become: yes
  36. ignore_errors: yes
  37. no_log: True
  38. failed_when: false
  39. when:
  40. - upgrade_without_gpu is not defined or upgrade_without_gpu == false