You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
1.0 KiB

  1. ---
  2. - name: "Download calico-upgrade tool (force version)"
  3. get_url:
  4. url: "https://github.com/projectcalico/calico-upgrade/releases/download/{{ calico_upgrade_version }}/calico-upgrade"
  5. dest: "{{ bin_dir }}/calico-upgrade"
  6. mode: 0755
  7. owner: root
  8. group: root
  9. force: yes
  10. - name: "Create etcdv2 and etcdv3 calicoApiConfig"
  11. template:
  12. src: "{{ item }}-store.yml.j2"
  13. dest: "/etc/calico/{{ item }}.yml"
  14. with_items:
  15. - "etcdv2"
  16. - "etcdv3"
  17. - name: "Tests data migration (dry-run)"
  18. shell: "{{ bin_dir }}/calico-upgrade dry-run --output-dir=/tmp --apiconfigv1 /etc/calico/etcdv2.yml --apiconfigv3 /etc/calico/etcdv3.yml"
  19. register: calico_upgrade_test_data
  20. failed_when: '"Successfully" not in calico_upgrade_test_data.stdout'
  21. - name: "If test migration is success continue with calico data real migration"
  22. shell: "{{ bin_dir }}/calico-upgrade start --no-prompts --apiconfigv1 /etc/calico/etcdv2.yml --apiconfigv3 /etc/calico/etcdv3.yml --output-dir=/tmp/calico_upgrade"
  23. register: calico_upgrade_migration_data