validate_idrac_vars.yml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. - block:
  16. - name: Include variable file idrac_vars.yml
  17. include_vars: "{{ idrac_input_filename }}"
  18. run_once: true
  19. tags: init
  20. - name: Assert firmware_update_required value
  21. assert:
  22. that:
  23. - firmware_update_required == true or firmware_update_required == false
  24. success_msg: "{{ firmware_update_success_msg }}"
  25. fail_msg: "{{ firmware_update_fail_msg }}"
  26. tags: [ validate, firmware-repo ]
  27. - name: Read poweredge_model file
  28. command: cat {{ role_path }}/files/poweredge_models.txt
  29. failed_when: false
  30. register: poweredge_models_file_output
  31. changed_when: false
  32. tags: [ validate, firmware-repo ]
  33. - name: Assert poweredge_model value
  34. assert:
  35. that:
  36. - item | length > 1
  37. - item in poweredge_models_file_output.stdout
  38. success_msg: "{{ poweredge_model_success_msg }}"
  39. fail_msg: "{{ poweredge_model_fail_msg }}"
  40. when: firmware_update_required
  41. with_items: "{{ poweredge_model.split(',') | map('trim') }}"
  42. tags: [ validate, firmware-repo ]
  43. when: idrac_support