---

- name: disable selinux
  selinux:
    state: disabled

- name: setup dind cluster with ovn
  shell: "OVN_ROOT={{ ansible_env.GOPATH }}/src/github.com/ovn-org/ovn-kubernetes hack/dind-cluster.sh start -n ovn"
  args:
    chdir: "{{ ansible_env.GOPATH }}/src/github.com/openshift/origin"

- name: ensure artifacts directory is present
  file: path={{ artifacts }} state=directory

- name: run integration tests
  shell: "OPENSHIFT_TEST_KUBECONFIG={{ openshift_dind_kubeconfig }} ./cni_vendor_test.sh &> {{ artifacts }}/cni_vendor_test.log"
  args:
    chdir: "{{ ansible_env.GOPATH }}/src/github.com/openshift/origin/test/extended"

- name: cleanup after integration tests
  shell: "./hack/dind-cluster.sh stop"
  args:
    chdir: "{{ ansible_env.GOPATH }}/src/github.com/openshift/origin"
