--- # input variables: # - l_docker_upgrade # - openshift.common.is_atomic # - node_config_hook # - openshift_pkg_version # - openshift.common.is_containerized # - deployment_type # - openshift_release # tasks file for openshift_node_upgrade - include: docker/upgrade.yml vars: # We will restart Docker ourselves after everything is ready: skip_docker_restart: True when: l_docker_upgrade is defined and l_docker_upgrade | bool and not openshift.common.is_atomic | bool - include: "{{ node_config_hook }}" when: node_config_hook is defined - include: rpm_upgrade.yml vars: component: "node" openshift_version: "{{ openshift_pkg_version | default('') }}" when: not openshift.common.is_containerized | bool - name: Remove obsolete docker-sdn-ovs.conf file: path=/etc/systemd/system/docker.service.d/docker-sdn-ovs.conf state=absent when: (deployment_type == 'openshift-enterprise' and openshift_release | version_compare('3.4', '>=')) or (deployment_type == 'origin' and openshift_release | version_compare('1.4', '>=')) - include: containerized_node_upgrade.yml when: openshift.common.is_containerized | bool - name: Ensure containerized services stopped before Docker restart service: name={{ item }} state=stopped with_items: - etcd_container - openvswitch - "{{ openshift.common.service_type }}-master" - "{{ openshift.common.service_type }}-master-api" - "{{ openshift.common.service_type }}-master-controllers" - "{{ openshift.common.service_type }}-node" failed_when: false when: openshift.common.is_containerized | bool - name: Upgrade openvswitch package: name: openvswitch state: latest register: ovs_pkg when: not openshift.common.is_containerized | bool - name: Restart openvswitch systemd: name: openvswitch state: restarted when: - not openshift.common.is_containerized | bool - ovs_pkg | changed # Mandatory Docker restart, ensure all containerized services are running: - include: docker/restart.yml - name: Restart rpm node service service: name="{{ openshift.common.service_type }}-node" state=restarted when: not openshift.common.is_containerized | bool - name: Wait for node to be ready command: > {{ hostvars[groups.oo_first_master.0].openshift.common.client_binary }} get node {{ openshift.common.hostname | lower }} --no-headers register: node_output delegate_to: "{{ groups.oo_first_master.0 }}" until: "{{ node_output.stdout.split()[1].startswith('Ready')}}" # Give the node two minutes to come back online. Note that we pre-pull images now # so containerized services should restart quickly as well. retries: 24 delay: 5 # AUDIT:changed_when: `false` because we are only inspecting the # state of the node, we aren't changing anything (we changed node # service state in the previous task). You could say we shouldn't # override this because something will be changing (the state of a # service), but that should be part of the last task. changed_when: false