check_prerequisites.yml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. # Copyright 2020 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 availability of iso file
  16. stat:
  17. path: "{{ role_path }}/files/{{ iso_name }}"
  18. register: iso_status
  19. - name: Iso file not present
  20. fail:
  21. msg: "{{ iso_fail }}"
  22. when: iso_status.stat.exists == false
  23. register: iso_file_check
  24. - name: Initialize variables
  25. set_fact:
  26. cobbler_status: false
  27. cobbler_image_status: false
  28. tags: install
  29. - name: Inspect the cobbler image
  30. docker_image_info:
  31. name: cobbler
  32. register: cobbler_image_result
  33. tags: install
  34. - name: Check cobbler status on the machine
  35. docker_container_info:
  36. name: cobbler
  37. register: cobbler_result
  38. tags: install
  39. - name: Update cobbler image status
  40. set_fact:
  41. cobbler_image_status: true
  42. when: cobbler_image_result.images| length==1
  43. tags: install
  44. - name: Update cobbler status
  45. set_fact:
  46. cobbler_status: true
  47. when: cobbler_result.exists
  48. tags: install