aboutsummaryrefslogtreecommitdiffstats
path: root/roles/xtesting-healthcheck-k8s-job/tasks/main.yaml
blob: 6ed429a4657b497124ec7957b60181fea66ab7f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
---
# tasks file for functest (tests)

##
- block:
    - name: create directories as root
      become: yes
      file:
        path: "{{ res_local_path }}/{{ run_tiers }}/{{ run_type }}"
        state: directory
        mode: 0755

    - name: Delete old logs
      become: yes
      file:
        state: absent
        path: "{{ res_local_path }}/{{ run_tiers }}/{{ run_type }}"

    - name: Delete healthcheck job
      k8s:
        state: absent
        api: batch/v1
        kind: Job
        namespace: onap
        name: "integration-onap-internal-check-certs"
        kubeconfig:  "{{ global_local_path }}/{{ kube_conf_file }}"

    - name: save internal check certs deployment to file
      copy:
        content: "{{ internal_check_certs_deployment | to_nice_yaml }}"
        dest:
          "{{ k8s_job__dir_path }}/healthcheck-internal-check-certs.yaml"

    - name: start internal check certs job
      k8s:
        state: present
        src: "{{ k8s_job__dir_path }}/healthcheck-internal-check-certs.yaml"
        kubeconfig: "{{ global_local_path }}/{{ kube_conf_file }}"
    - name: Wait until the healthcheck test is "completed"
      wait_for:
        timeout: "{{ run_timeout }}"
        path: "{{ res_local_path }}/{{ run_tiers }}/{{ run_type }}/xtesting.log"
        search_regex: Result.EX_
  always:
    - name: "save healthcheck {{ run_type }} results for artifacts"
      synchronize:
        src: "{{ res_local_path }}/{{ run_tiers }}/{{ run_type }}"
        use_ssh_args: true
        dest: "./results/{{ run_tiers }}"
        mode: pull
      ignore_errors: True