main.yml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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: Disable swap
  43. command: /sbin/swapoff -a
  44. changed_when: true
  45. tags: install
  46. - name: Disable selinux
  47. selinux:
  48. state: disabled
  49. tags: install
  50. - name: Install common packages
  51. package:
  52. name: "{{ common_packages }}"
  53. state: present
  54. tags: install
  55. - name: Collect host facts (including acclerator information)
  56. setup: ~
  57. - name: Install infiniBand support
  58. package:
  59. name: "@Infiniband Support"
  60. state: present
  61. tags: install
  62. - name: Deploy time ntp/chrony
  63. include_tasks: ntp.yml
  64. tags: install
  65. - name: Install Nvidia drivers and software components
  66. include_tasks: nvidia.yml
  67. when: ansible_local.inventory.nvidia_gpu > 0
  68. tags: install