validate_idrac_vars.yml 1.4 KB

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