restart.yml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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: restarted
  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: Start services
  30. service: name={{ item }} state=started
  31. with_items:
  32. - "{{ openshift_service_type }}-node"
  33. failed_when: false
  34. - name: Wait for master API to come back online
  35. wait_for:
  36. host: "{{ openshift.common.hostname }}"
  37. state: started
  38. delay: 10
  39. port: "{{ openshift_master_api_port }}"
  40. timeout: 600
  41. when: inventory_hostname in groups.oo_masters_to_config