main.yml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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: Add docker community edition repository
  38. get_url:
  39. url: "{{ docker_repo_url }}"
  40. dest: "{{ docker_repo_dest }}"
  41. tags: install
  42. - name: Permanently Disable swap
  43. mount:
  44. name: "swap"
  45. fstype: swap
  46. state: absent
  47. - name: Disable selinux
  48. selinux:
  49. state: disabled
  50. tags: install
  51. - name: Install common packages
  52. package:
  53. name: "{{ common_packages }}"
  54. state: present
  55. tags: install
  56. - name: Collect host facts (including acclerator information)
  57. setup: ~
  58. - name: Install infiniBand support
  59. package:
  60. name: "@Infiniband Support"
  61. state: present
  62. tags: install
  63. - name: Deploy time ntp/chrony
  64. include_tasks: ntp.yml
  65. tags: install
  66. - name: Install Nvidia drivers and software components
  67. include_tasks: nvidia.yml
  68. when: ansible_local.inventory.nvidia_gpu > 0
  69. tags: install
  70. - name: Install AMD GPU drivers and software components
  71. include_tasks: amd.yml
  72. when: ansible_local.inventory.amd_gpu > 0
  73. tags: install