ansible-role-k8s-mariadb/tests/roles/openshift/tasks/run.yml

73 lines
1.7 KiB
YAML

---
- shell:
cmd: |
set -e
set -x
oc cluster up
oc login -u system:admin
oc delete scc anyuid hostaccess hostmount-anyuid hostnetwork privileged nonroot restricted
cat <<EOF | oc create -f -
kind: SecurityContextConstraints
apiVersion: v1
metadata:
name: permissive
allowHostDirVolumePlugin: true
allowHostIPC: true
allowHostNetwork: true
allowHostPID: true
allowHostPorts: true
allowPrivilegedContainer: true
allowedCapabilities:
- '*'
runAsUser:
type: RunAsAny
seLinuxContext:
type: RunAsAny
groups:
- system:authenticated
defaultAddCapabilities: []
fsGroup:
type: RunAsAny
EOF
sudo mkdir /tmp/test-volume
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/test-volume
EOF
sudo chown zuul:zuul -R /tmp/test-volume
sudo chmod 777 /tmp/test-volume
executable: /bin/bash
become: true
delegate_to: "primary"
environment: '{{ zuul | zuul_legacy_vars }}'
register: oc_output
- name: Login to OpenShift
shell:
cmd: |
set -e
set -x
oc login https://127.0.0.1:8443 --insecure-skip-tls-verify=true -u developer -p developer
oc new-project openstack
executable: /bin/bash
delegate_to: "primary"
environment: '{{ zuul | zuul_legacy_vars }}'