diff --git a/mcapi_vexxhost/playbooks/functional_test.yml b/mcapi_vexxhost/playbooks/functional_test.yml index 693b8d20..801a6851 100644 --- a/mcapi_vexxhost/playbooks/functional_test.yml +++ b/mcapi_vexxhost/playbooks/functional_test.yml @@ -31,6 +31,8 @@ functional_test_master_count: 1 functional_test_node_count: 1 + functional_test_kubeconfig_file: "{{ '/root/' ~ 'kubeconfig-' ~ functional_test_cluster_name ~ '/config' }}" + functional_test_resources_network: networks: - name: 'public' @@ -135,11 +137,25 @@ environment: OS_CLOUD: default + - name: Create dir to hold kubeconfig + ansible.builtin.file: + state: directory + path: "{{ functional_test_kubeconfig_file | dirname }}" + + - name: Retrieve kubeconfig + vars: + ansible_python_interpreter: "{{ openstack_service_setup_host_python_interpreter }}" + ansible.builtin.command: + cmd: openstack coe cluster config --dir "{{ functional_test_kubeconfig_file | dirname }}" "{{ functional_test_cluster_name }}" + creates: "{{ functional_test_kubeconfig_file }}" + environment: + OS_CLOUD: default + - name: Run sonobuoy test include_role: name: osa_ops.mcapi_vexxhost.sonobuoy vars: - sonobuoy_coe_cluster: "{{ functional_test_cluster_name }}" + sonobuoy_kubeconfig_file: "{{ functional_test_kubeconfig_file }}" # Delete cluster - name: Delete coe cluster diff --git a/mcapi_vexxhost/roles/sonobuoy/defaults/main.yml b/mcapi_vexxhost/roles/sonobuoy/defaults/main.yml index ee18a052..ce14a72d 100644 --- a/mcapi_vexxhost/roles/sonobuoy/defaults/main.yml +++ b/mcapi_vexxhost/roles/sonobuoy/defaults/main.yml @@ -18,7 +18,7 @@ sonobuoy_download_url: "https://github.com/vmware-tanzu/sonobuoy/releases/downlo sonobuoy_unarchive_dest: /usr/local/bin # set the name or uuid of the openstack coe cluster to test -sonobuoy_coe_cluster: "" +sonobuoy_coe_cluster: "test" # the location of the kubeconfig file sonobuoy_kubeconfig_file: "{{ '/root/' ~ 'kubeconfig-' ~ sonobuoy_coe_cluster ~ '/config' }}" diff --git a/mcapi_vexxhost/roles/sonobuoy/tasks/main.yml b/mcapi_vexxhost/roles/sonobuoy/tasks/main.yml index cd20e7c2..6cf5ae14 100644 --- a/mcapi_vexxhost/roles/sonobuoy/tasks/main.yml +++ b/mcapi_vexxhost/roles/sonobuoy/tasks/main.yml @@ -12,20 +12,6 @@ # License for the specific language governing permissions and limitations # under the License. -- name: Create dir to hold kubeconfig - ansible.builtin.file: - state: directory - path: "{{ sonobuoy_kubeconfig_file | dirname }}" - -- name: Retrieve kubeconfig - vars: - ansible_python_interpreter: "{{ openstack_service_setup_host_python_interpreter }}" - ansible.builtin.command: - cmd: openstack coe cluster config --dir "{{ sonobuoy_kubeconfig_file | dirname }}" "{{ sonobuoy_coe_cluster }}" - creates: "{{ sonobuoy_kubeconfig_file }}" - environment: - OS_CLOUD: default - - name: Run sonobuoy tests when: sonobuoy_run environment: