main.yml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. ---
  2. # For 1.4/3.4 we want to upgrade everyone to etcd-3.0. etcd docs say to
  3. # upgrade from 2.0.x to 2.1.x to 2.2.x to 2.3.x to 3.0.x. While this is a tedius
  4. # task for RHEL and CENTOS it's simply not possible in Fedora unless you've
  5. # mirrored packages on your own because only the GA and latest versions are
  6. # available in the repos. So for Fedora we'll simply skip this, sorry.
  7. - include: ../../evaluate_groups.yml
  8. tags:
  9. - always
  10. # We use two groups one for hosts we're upgrading which doesn't include embedded etcd
  11. # The other for backing up which includes the embedded etcd host, there's no need to
  12. # upgrade embedded etcd that just happens when the master is updated.
  13. - name: Evaluate additional groups for etcd
  14. hosts: localhost
  15. connection: local
  16. become: no
  17. tasks:
  18. - name: Evaluate etcd_hosts_to_upgrade
  19. add_host:
  20. name: "{{ item }}"
  21. groups: etcd_hosts_to_upgrade
  22. with_items: "{{ groups.oo_etcd_to_config if groups.oo_etcd_to_config is defined and groups.oo_etcd_to_config | length > 0 else [] }}"
  23. changed_when: False
  24. - name: Evaluate etcd_hosts_to_backup
  25. add_host:
  26. name: "{{ item }}"
  27. groups: etcd_hosts_to_backup
  28. with_items: "{{ groups.oo_etcd_to_config if groups.oo_etcd_to_config is defined and groups.oo_etcd_to_config | length > 0 else groups.oo_first_master }}"
  29. changed_when: False
  30. - name: Backup etcd before upgrading anything
  31. include: backup.yml
  32. vars:
  33. backup_tag: "pre-upgrade-"
  34. when: openshift_etcd_backup | default(true) | bool
  35. - name: Drop etcdctl profiles
  36. hosts: etcd_hosts_to_upgrade
  37. tasks:
  38. - include: roles/etcd/tasks/etcdctl.yml
  39. - name: Perform etcd upgrade
  40. include: ./upgrade.yml
  41. when: openshift_etcd_upgrade | default(true) | bool