---

- when: cni_install_mode != 'none'
  block:

    - name: Download the CNI plugins
      get_url:
        url: "{{ cni_archive_url }}"
        dest: "{{ cni_root_dir }}/tmp"
        checksum: sha256:{{ cni_archive_sha256 }}

    - name: Extract archive
      unarchive:
        src: "{{ cni_root_dir }}/tmp/cni-plugins-linux-amd64-v{{ cni_version }}.tgz"
        dest: "{{ cni_root_dir }}/bin/"
        remote_src: True

  tags: cni
