ansible-role-k8s-mariadb/tests/templates/playbook.j2

57 lines
1.3 KiB
Django/Jinja

{% if coe == 'kubernetes' %}
- name: Prepare COE cluster
hosts: localhost
gather_facts: false
connection: local
vars:
namespace: openstack
coe_host: "http://localhost:8080"
tasks:
- name: Create test PV
shell:
cmd: |
cat <<EOF | kubectl create -f -
apiVersion: v1
kind: PersistentVolume
metadata:
name: openstack-test-volume
spec:
capacity:
storage: 5Gi
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Recycle
storageClassName: slow
hostPath:
path: /tmp
EOF
{% endif %}
- name: Provision {{project_name}}
hosts: localhost
gather_facts: false
connection: local
vars:
namespace: openstack
{% if coe == 'kubernetes' %}
coe_host: "http://localhost:8080"
{% endif %}
roles:
{% for dep in ansible_role_k8s_required|default('', true) %}
- role: {{dep}}
playbook_debug: false
{% endfor %}
- role: {{project_name}}
playbook_debug: false
tasks:
- include: "{% raw %}{{ item }}{% endraw %}"
with_first_found:
- files:
- '{{ ansible_env.HOME }}/{{ zuul.project.src_dir }}/tests/tests.yml'
skip: true