restart.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. ---
  2. # input variables:
  3. # - openshift.common.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 docker
  15. service:
  16. name: "{{ openshift.docker.service_name }}"
  17. state: started
  18. register: docker_start_result
  19. until: not docker_start_result | failed
  20. retries: 3
  21. delay: 30
  22. - name: Update docker facts
  23. openshift_facts:
  24. role: docker
  25. - name: Start services
  26. service: name={{ item }} state=started
  27. with_items:
  28. - etcd_container
  29. - openvswitch
  30. - "{{ openshift.common.service_type }}-master-api"
  31. - "{{ openshift.common.service_type }}-master-controllers"
  32. - "{{ openshift.common.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