pre_requisites.yml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # Copyright 2021 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. # pre-req
  16. - name: Create directories if they don't exist
  17. block:
  18. - name: Checking directory
  19. stat:
  20. path: "{{ item }}"
  21. register: stat_result
  22. with_items:
  23. - "{{ subnet_manager.cache_directory }}"
  24. - "{{ subnet_manager.log_directory }}"
  25. loop_control:
  26. label: "{{ item }}"
  27. tags: install
  28. - name: Creating directories
  29. file:
  30. path: "{{ item.item }}"
  31. state: directory
  32. mode: "{{ folder_perm }}"
  33. group: root
  34. owner: root
  35. when: not item.stat.exists
  36. loop: "{{ stat_result.results }}"
  37. loop_control:
  38. label: "{{ item.item }}"
  39. tags: install
  40. - name: Copy opensm configuration file
  41. copy:
  42. src: "{{ opensm_conf_file }}"
  43. dest: "{{ opensm_conf_file_dest }}"
  44. mode: preserve
  45. force: yes
  46. tags: install