check_prerequisites.yml 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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: Initialize variables
  16. set_fact:
  17. cobbler_status: false
  18. cobbler_image_status: false
  19. tags: install
  20. - name: Inspect the cobbler image
  21. docker_image_info:
  22. name: cobbler
  23. register: cobbler_image_result
  24. tags: install
  25. - name: Check cobbler status on the machine
  26. docker_container_info:
  27. name: cobbler
  28. register: cobbler_result
  29. tags: install
  30. - name: Update cobbler image status
  31. set_fact:
  32. cobbler_image_status: true
  33. when: cobbler_image_result.images| length==1
  34. tags: install
  35. - name: Update cobbler status
  36. set_fact:
  37. cobbler_status: true
  38. when: cobbler_result.exists
  39. tags: install