mirror of https://github.com/ansible/ansible.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.4 KiB
YAML
52 lines
1.4 KiB
YAML
6 years ago
|
- python_requirements_facts:
|
||
|
dependencies:
|
||
|
- openshift==0.6.0
|
||
|
- kubernetes==6.0.0
|
||
|
|
||
|
# append_hash
|
||
|
- name: use append_hash with ConfigMap
|
||
|
k8s:
|
||
|
definition:
|
||
|
metadata:
|
||
|
name: config-map-test
|
||
|
namespace: "{{ playbook_namespace }}"
|
||
|
apiVersion: v1
|
||
|
kind: ConfigMap
|
||
|
data:
|
||
|
hello: world
|
||
|
append_hash: yes
|
||
|
ignore_errors: yes
|
||
|
register: k8s_append_hash
|
||
|
|
||
|
- name: assert that append_hash fails gracefully
|
||
|
assert:
|
||
|
that:
|
||
|
- k8s_append_hash is failed
|
||
6 years ago
|
- "'Failed to import the required Python library (openshift >= 0.7.2)' in k8s_append_hash.msg"
|
||
|
- "'. This is required for append_hash.' in k8s_append_hash.msg"
|
||
6 years ago
|
|
||
|
# merge_type
|
||
6 years ago
|
- include_tasks: crd.yml
|
||
6 years ago
|
|
||
|
# validate
|
||
|
- name: attempt to use validate with older openshift
|
||
|
k8s:
|
||
|
definition:
|
||
|
metadata:
|
||
|
name: config-map-test
|
||
|
namespace: "{{ playbook_namespace }}"
|
||
|
apiVersion: v1
|
||
|
kind: ConfigMap
|
||
|
data:
|
||
|
hello: world
|
||
|
validate:
|
||
|
fail_on_error: yes
|
||
|
ignore_errors: yes
|
||
|
register: k8s_validate
|
||
|
|
||
|
- name: assert that validate fails gracefully
|
||
|
assert:
|
||
|
that:
|
||
|
- k8s_validate is failed
|
||
6 years ago
|
- "k8s_validate.msg == 'openshift >= 0.8.0 is required for validate'"
|