stop_services.yml 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. ---
  2. - name: Stop node and openvswitch services
  3. service:
  4. name: "{{ item }}"
  5. state: stopped
  6. with_items:
  7. - "{{ openshift_service_type }}-node"
  8. - openvswitch
  9. failed_when: false
  10. - name: Ensure containerized services stopped before Docker restart
  11. service:
  12. name: "{{ item }}"
  13. state: stopped
  14. with_items:
  15. - etcd_container
  16. - openvswitch
  17. - "{{ openshift_service_type }}-master-api"
  18. - "{{ openshift_service_type }}-master-controllers"
  19. - "{{ openshift_service_type }}-node"
  20. failed_when: false
  21. when: openshift.common.is_containerized | bool
  22. - service:
  23. name: docker
  24. state: stopped
  25. register: l_openshift_node_upgrade_docker_stop_result
  26. until: not (l_openshift_node_upgrade_docker_stop_result is failed)
  27. retries: 3
  28. delay: 30
  29. when:
  30. - l_docker_upgrade is defined
  31. - l_docker_upgrade | bool
  32. - name: Stop rpm based services
  33. service:
  34. name: "{{ item }}"
  35. state: stopped
  36. with_items:
  37. - "{{ openshift_service_type }}-node"
  38. - openvswitch
  39. failed_when: false
  40. when: not openshift.common.is_containerized | bool