check_prerequisites.yml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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 KIiND, 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. mngmnt_network_container_status: false
  18. mngmnt_network_container_image_status: false
  19. backup_mngmnt_map_status: false
  20. new_mngmnt_node_status: false
  21. tags: install
  22. - name: Check if any backup file exists
  23. block:
  24. - name: Check status of backup file
  25. stat:
  26. path: "{{ role_path }}/files/backup_mngmnt_mapping_file.csv"
  27. register: backup_mngmnt_map
  28. - name: Set status for backup file
  29. set_fact:
  30. backup_mngmnt_map_status: true
  31. when: backup_mngmnt_map.stat.exists
  32. rescue:
  33. - name: Message
  34. debug:
  35. msg: "All nodes are new"
  36. verbosity: 2
  37. - name: Inspect the mngmnt_network_container image
  38. command: "buildah images"
  39. register: mngmnt_network_container_image_result
  40. failed_when: false
  41. changed_when: false
  42. tags: install
  43. - name: Check mngmnt_network_container status on the machine
  44. command: kubectl get pods -n network-config
  45. register: mngmnt_network_container_result
  46. failed_when: false
  47. changed_when: false
  48. tags: install
  49. - name: Update mngmnt_network_container image status
  50. set_fact:
  51. mngmnt_network_container_image_status: true
  52. when: mngmnt_network_image_name in mngmnt_network_container_image_result.stdout
  53. tags: install
  54. - name: Update mngmnt_network_container container status
  55. set_fact:
  56. mngmnt_network_container_status: true
  57. when: "'mngmnt-network-container' in mngmnt_network_container_result.stdout"
  58. tags: install