validate_idrac_vars.yml 1.6 KB

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