blob: 9f700c62c53531a447732210129f163956e66953 (
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
|
#!/usr/bin/ansible-playbook --module-path=../../../library/
# ./oc_project.yml -M ../../../library -e "cli_master_test=$OPENSHIFT_MASTER
---
- hosts: "{{ cli_master_test }}"
gather_facts: no
user: root
tasks:
- name: create a project
oc_project:
display_name: operations project
name: operations
state: present
description: All things operations
node_selector:
- ops_only=true
register: projout
- debug: var=projout
- assert:
that:
- "projout.results.results['metadata']['name'] == 'operations'"
- projout.changed
msg: project create failed.
- name: create a project
oc_project:
display_name: operations project
name: operations
state: present
description: All things operations
node_selector:
- ops_only=true
register: projout
- debug: var=projout
- assert:
that:
- "projout.results.results['metadata']['name'] == 'operations'"
- projout.changed == False
msg: project create failed.
- name: update a project
oc_project:
display_name: operations project one
name: operations
state: present
description: All things operations
node_selector:
- ops_only=true
register: projout
- debug: var=projout
- assert:
that:
- "projout.results.results['metadata']['annotations']['openshift.io/display-name'] == 'operations project one'"
- projout.changed == True
msg: project create failed.
- name: update a project
oc_project:
name: operations
state: list
register: projout
- debug: var=projout
- assert:
that:
- "projout.results['metadata']['annotations']['openshift.io/display-name'] == 'operations project one'"
- projout.changed == False
- projout.state == 'list'
msg: project list failed.
- name: delete a project
oc_project:
name: operations
state: absent
register: projout
- debug: var=projout
- assert:
that:
- projout.changed == True
msg: project delete failed.
|