summaryrefslogtreecommitdiff
path: root/test/integration/targets/k8s/tasks/main.yml
blob: f1fc919b917711fb7d9925fa84d5997c4d83b3fc (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
- set_fact:
    virtualenv: "{{ remote_tmp_dir }}/virtualenv"
    virtualenv_command: "{{ ansible_python_interpreter }} -m virtualenv"

- set_fact:
    virtualenv_interpreter: "{{ virtualenv }}/bin/python"

- pip:
    name: virtualenv

# Test graceful failure for missing kubernetes-validate

- pip:
    name:
      - 'openshift>=0.9.0'
      - coverage
    virtualenv: "{{ virtualenv }}"
    virtualenv_command: "{{ virtualenv_command }}"
    virtualenv_site_packages: no

- include_tasks: validate_not_installed.yml
  vars:
    ansible_python_interpreter: "{{ virtualenv_interpreter }}"

- file:
    path: "{{ virtualenv }}"
    state: absent

# Test validate with kubernetes-validate

- pip:
    name:
      - kubernetes-validate==1.12.0
      - 'openshift>=0.9.0'
      - coverage
    virtualenv: "{{ virtualenv }}"
    virtualenv_command: "{{ virtualenv_command }}"
    virtualenv_site_packages: no

- include_tasks: validate_installed.yml
  vars:
    ansible_python_interpreter: "{{ virtualenv_interpreter }}"
    playbook_namespace: ansible-test-k8s-validate

- file:
    path: "{{ virtualenv }}"
    state: absent

# Test graceful failure for older versions of openshift

- pip:
    name:
      - openshift==0.6.0
      - kubernetes==6.0.0
      - coverage
    virtualenv: "{{ virtualenv }}"
    virtualenv_command: "{{ virtualenv_command }}"
    virtualenv_site_packages: no

- include_tasks: older_openshift_fail.yml
  vars:
    ansible_python_interpreter: "{{ virtualenv_interpreter }}"
    recreate_crd_default_merge_expectation: recreate_crd is failed
    playbook_namespace: ansible-test-k8s-older-openshift

- file:
    path: "{{ virtualenv }}"
    state: absent

# Run full test suite

- pip:
    name:
      - 'openshift>=0.9.0'
      - coverage
    virtualenv: "{{ virtualenv }}"
    virtualenv_command: "{{ virtualenv_command }}"
    virtualenv_site_packages: no

- include_tasks: full_test.yml
  vars:
    ansible_python_interpreter: "{{ virtualenv_interpreter }}"
    create_crd_with_apply: no
    playbook_namespace: ansible-test-k8s-full

- file:
    path: "{{ virtualenv }}"
    state: absent