blob: fb3a4781f7d5e509b9e8cddd8fe9a584f396c476 (
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
|
#!/usr/bin/ansible-playbook --module-path=../../../library/
# ./oc_pvc.yml -e "cli_master_test=$OPENSHIFT_MASTER
---
- hosts: "{{ cli_master_test }}"
gather_facts: no
user: root
tasks:
- name: create pvc
oc_pvc:
state: present
name: oc-pvc-create-test
namespace: default
volume_capacity: 3G
access_modes:
- ReadWriteOnce
selector:
foo: bar
storage_class_name: my-storage-class-name
register: pvcout
- debug: var=pvcout
- assert:
that:
- pvcout.results.results[0]['metadata']['name'] == 'oc-pvc-create-test'
- pvcout.results.results[0]['spec']['storageClassName'] == 'my-storage-class-name'
- pvcout.results.results[0]['spec']['selector']['matchLabels']['foo'] == 'bar'
- pvcout.changed
msg: pvc create failed.
|