containerized_tasks.yml 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. ---
  2. - name: Verify cluster is healthy pre-upgrade
  3. command: "etcdctl --cert-file /etc/etcd/peer.crt --key-file /etc/etcd/peer.key --ca-file /etc/etcd/ca.crt -C https://{{ openshift.common.hostname }}:2379 cluster-health"
  4. - name: Update systemd unit
  5. openshift_facts:
  6. role: etcd
  7. - name: Set etcd3 image name
  8. set_fact:
  9. new_etcd_image: "{{ openshift.etcd.etcd_image | regex_replace('/etcd$','/etcd3') }}"
  10. - name: Pull new etcd image
  11. command: "docker pull {{ new_etcd_image }}"
  12. - name: Update to latest etcd image
  13. replace:
  14. dest: /etc/systemd/system/etcd_container.service
  15. regexp: "{{ openshift.etcd.etcd_image }}$"
  16. replace: "{{ new_etcd_image }}"
  17. - name: Update etcd package not excluding etcd3
  18. systemd:
  19. name: etcd_container
  20. daemon_reload: yes
  21. state: restarted
  22. - name: Verify cluster is healthy
  23. command: "etcdctl --cert-file /etc/etcd/peer.crt --key-file /etc/etcd/peer.key --ca-file /etc/etcd/ca.crt -C https://{{ openshift.common.hostname }}:2379 cluster-health"
  24. register: etcdctl
  25. until: etcdctl.rc == 0
  26. retries: 3
  27. delay: 10
  28. - name: Store new etcd_image
  29. openshift_facts:
  30. role: etcd
  31. local_facts:
  32. - etcd_image: "{{ new_etcd_image }}"