123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- ---
- - name: Determine etcd version
- hosts: oo_etcd_hosts_to_upgrade
- tasks:
- - block:
- - name: Record RPM based etcd version
- command: rpm -qa --qf '%{version}' etcd\*
- args:
- warn: no
- register: etcd_rpm_version
- failed_when: false
- # AUDIT:changed_when: `false` because we are only inspecting
- # state, not manipulating anything
- changed_when: false
- - debug:
- msg: "Etcd rpm version {{ etcd_rpm_version.stdout }} detected"
- when:
- - not openshift.common.is_containerized | bool
- - block:
- - name: Record containerized etcd version (docker)
- command: docker exec etcd_container rpm -qa --qf '%{version}' etcd\*
- register: etcd_container_version_docker
- failed_when: false
- # AUDIT:changed_when: `false` because we are only inspecting
- # state, not manipulating anything
- changed_when: false
- when:
- - not openshift.common.is_etcd_system_container | bool
- # Given a register variables is set even if the whwen condition
- # is false, we need to set etcd_container_version separately
- - set_fact:
- etcd_container_version: "{{ etcd_container_version_docker.stdout }}"
- when:
- - not openshift.common.is_etcd_system_container | bool
- - name: Record containerized etcd version (runc)
- command: runc exec etcd rpm -qa --qf '%{version}' etcd\*
- register: etcd_container_version_runc
- failed_when: false
- # AUDIT:changed_when: `false` because we are only inspecting
- # state, not manipulating anything
- changed_when: false
- when:
- - openshift.common.is_etcd_system_container | bool
- # Given a register variables is set even if the whwen condition
- # is false, we need to set etcd_container_version separately
- - set_fact:
- etcd_container_version: "{{ etcd_container_version_runc.stdout }}"
- when:
- - openshift.common.is_etcd_system_container | bool
- - debug:
- msg: "Etcd containerized version {{ etcd_container_version }} detected"
- when:
- - openshift.common.is_containerized | bool
- - include: upgrade_rpm_members.yml
- vars:
- etcd_upgrade_version: '2.1'
- - include: upgrade_rpm_members.yml
- vars:
- etcd_upgrade_version: '2.2'
- - include: upgrade_image_members.yml
- vars:
- etcd_upgrade_version: '2.2.5'
- - include: upgrade_rpm_members.yml
- vars:
- etcd_upgrade_version: '2.3'
- - include: upgrade_image_members.yml
- vars:
- etcd_upgrade_version: '2.3.7'
- - include: upgrade_rpm_members.yml
- vars:
- etcd_upgrade_version: '3.0'
- - include: upgrade_image_members.yml
- vars:
- etcd_upgrade_version: '3.0.15'
- - include: upgrade_rpm_members.yml
- vars:
- etcd_upgrade_version: '3.1'
- - include: upgrade_image_members.yml
- vars:
- etcd_upgrade_version: '3.1.3'
- - include: upgrade_rpm_members.yml
- vars:
- etcd_upgrade_version: '3.2'
- - include: upgrade_image_members.yml
- vars:
- etcd_upgrade_version: '3.2.7'
- - name: Upgrade fedora to latest
- hosts: oo_etcd_hosts_to_upgrade
- serial: 1
- tasks:
- - include_role:
- name: etcd
- tasks_from: upgrade_image
- vars:
- r_etcd_common_etcd_runtime: "host"
- etcd_peer: "{{ openshift.common.hostname }}"
- when:
- - ansible_distribution == 'Fedora'
- - not openshift.common.is_containerized | bool
|