main.yml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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: Create a custom fact directory on each host
  16. file:
  17. path: "{{ custom_fact_dir }}"
  18. state: directory
  19. mode: "{{ custom_fact_dir_mode }}"
  20. - name: Install accelerator discovery script
  21. copy:
  22. src: inventory.fact
  23. dest: "{{ accelerator_discovery_script_dest }}"
  24. owner: root
  25. group: root
  26. mode: "{{ accelerator_discovery_script_mode }}"
  27. - name: Add elrepo GPG key
  28. rpm_key:
  29. state: present
  30. key: "{{ elrepo_gpg_key_url }}"
  31. tags: install
  32. - name: Add elrepo (nvidia kmod drivers)
  33. package:
  34. name: "{{ elrepo_rpm_url }}"
  35. state: present
  36. tags: install
  37. - name: Disable swap
  38. command: /sbin/swapoff -a
  39. changed_when: true
  40. tags: install
  41. - name: Disable selinux
  42. selinux:
  43. state: disabled
  44. tags: install
  45. - name: Install common packages
  46. package:
  47. name: "{{ common_packages }}"
  48. state: present
  49. tags: install
  50. - name: Collect host facts (including acclerator information)
  51. setup: ~
  52. - name: Install infiniBand support
  53. package:
  54. name: "@Infiniband Support"
  55. state: present
  56. tags: install
  57. - name: Deploy time ntp/chrony
  58. include_tasks: ntp.yml
  59. tags: install
  60. - name: Install Nvidia drivers and software components
  61. include_tasks: nvidia.yml
  62. when: ansible_local.inventory.nvidia_gpu > 0