restart.yml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. ---
  2. # input variables:
  3. # - openshift_service_type
  4. # - openshift.common.hostname
  5. # - openshift_master_api_port
  6. # NOTE: This is needed to make sure we are using the correct set
  7. # of systemd unit files. The RPMs lay down defaults but
  8. # the install/upgrade may override them in /etc/systemd/system/.
  9. # NOTE: We don't use the systemd module as some versions of the module
  10. # require a service to be part of the call.
  11. - name: Reload systemd to ensure latest unit files
  12. command: systemctl daemon-reload
  13. - name: Restart support services
  14. service:
  15. name: "{{ item }}"
  16. state: started
  17. enabled: True
  18. with_items:
  19. - NetworkManager
  20. - dnsmasq
  21. - name: Restart container runtime
  22. service:
  23. name: "{{ openshift_docker_service_name }}"
  24. state: started
  25. register: docker_start_result
  26. until: not (docker_start_result is failed)
  27. retries: 3
  28. delay: 30
  29. - name: Restart cri-o
  30. service:
  31. name: cri-o
  32. state: started
  33. when: openshift_use_crio | bool
  34. - name: Start node service
  35. service:
  36. name: "{{ openshift_service_type }}-node"
  37. state: started
  38. async: 300
  39. poll: 0
  40. register: node_service
  41. failed_when: false
  42. - name: Check status of node service
  43. async_status:
  44. jid: "{{ node_service.ansible_job_id }}"
  45. register: job_result
  46. until: job_result.finished
  47. retries: 30
  48. delay: 10
  49. - name: Wait for master API to come back online
  50. wait_for:
  51. host: "{{ openshift.common.hostname }}"
  52. state: started
  53. delay: 10
  54. port: "{{ openshift_master_api_port }}"
  55. timeout: 600
  56. when: inventory_hostname in groups.oo_masters_to_config