restart.yml 1.4 KB

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