fetch_sm_inputs.yml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. # Copyright 2022 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: Check that the ib_vars.yml exists
  16. stat:
  17. path: "{{ ib_config_file }}"
  18. register: stat_result
  19. tags: init
  20. - name: Fail if config file doesn't exist
  21. fail:
  22. msg: "{{ fail_msg_config_file }}"
  23. when: not stat_result.stat.exists
  24. tags: init
  25. - name: Check that the opensm.conf exists
  26. stat:
  27. path: "{{ opensm_conf_file }}"
  28. register: stat_result
  29. tags: init
  30. - name: Fail if opensm.conf file doesn't exist
  31. fail:
  32. msg: "{{ fail_msg_opensm_config_file }}"
  33. when: not stat_result.stat.exists
  34. tags: init
  35. - name: Include infiniband variable file
  36. include_vars: "{{ ib_config_file }}"
  37. tags: init
  38. - name: Validate directory input definition
  39. fail:
  40. msg: "{{ fail_msg_ib_input_definition }}"
  41. tags: [ validate, network-ib ]
  42. when:
  43. - subnet_manager.cache_directory is not defined or subnet_manager.log_directory is not defined
  44. - name: Validate directory input
  45. fail:
  46. msg: "{{ fail_msg_ib_input }}"
  47. tags: [ validate, network-ib ]
  48. when:
  49. - subnet_manager.cache_directory | length < 1
  50. - subnet_manager.log_directory | length < 1