From 150448c493fa10c4e37859e654b0d804ac692843 Mon Sep 17 00:00:00 2001 From: Bikouo Aubin <79859644+abikouo@users.noreply.github.com> Date: Wed, 28 Feb 2024 18:52:54 +0100 Subject: [PATCH] Create discovery.yml --- .../targets/k8s_info/tasks/discovery.yml | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 tests/integration/targets/k8s_info/tasks/discovery.yml diff --git a/tests/integration/targets/k8s_info/tasks/discovery.yml b/tests/integration/targets/k8s_info/tasks/discovery.yml new file mode 100644 index 0000000000..36c01bec4b --- /dev/null +++ b/tests/integration/targets/k8s_info/tasks/discovery.yml @@ -0,0 +1,32 @@ +--- +# Testing fix for issue https://github.com/ansible-collections/kubernetes.core/pull/676 +- vars: + kubevirt_release: "v1.1.1" + block: + - name: Delete existing namespace + kubernetes.core.k8s: + kind: namespace + namespace: kubevirt + state: absent + + - name: Create kubevirt resources + kubernetes.core.k8s: + state: present + apply: true + src: "{{ item }}" + with_items: + - "https://github.com/kubevirt/kubevirt/releases/download/{{ kubevirt_release }}/kubevirt-operator.yaml" + - "https://github.com/kubevirt/kubevirt/releases/download/{{ kubevirt_release }}/kubevirt-cr.yaml" + + - name: Read kubevirt Deployment + k8s_info: + kind: Deployment + namespace: kubevirt + always: + - name: Delete existing namespace + kubernetes.core.k8s: + kind: namespace + namespace: kubevirt + state: absent + wait: true + ignore_errors: true