---
- name: Determine etcd version
  hosts: oo_etcd_hosts_to_upgrade
  tasks:
  - import_role:
      name: etcd
      tasks_from: version_detect.yml

- import_playbook: upgrade_rpm_members.yml
  vars:
    etcd_upgrade_version: '2.1'

- import_playbook: upgrade_rpm_members.yml
  vars:
    etcd_upgrade_version: '2.2'

- import_playbook: upgrade_image_members.yml
  vars:
    etcd_upgrade_version: '2.2.5'

- import_playbook: upgrade_rpm_members.yml
  vars:
    etcd_upgrade_version: '2.3'

- import_playbook: upgrade_image_members.yml
  vars:
    etcd_upgrade_version: '2.3.7'

- import_playbook: upgrade_rpm_members.yml
  vars:
    etcd_upgrade_version: '3.0'

- import_playbook: upgrade_image_members.yml
  vars:
    etcd_upgrade_version: '3.0.15'

- import_playbook: upgrade_rpm_members.yml
  vars:
    etcd_upgrade_version: '3.1'

- import_playbook: upgrade_image_members.yml
  vars:
    etcd_upgrade_version: '3.1.3'

- import_playbook: upgrade_rpm_members.yml
  vars:
    etcd_upgrade_version: '3.2'

- import_playbook: 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:
  - import_role:
      name: etcd
      tasks_from: upgrade_image.yml
    vars:
      etcd_peer: "{{ openshift.common.hostname }}"
    when:
    - ansible_distribution == 'Fedora'
    - not openshift_is_containerized | bool
