---
apiVersion: batch/v1
kind: Job
metadata:
  generateName: litmus-jiva-openebs-ns-
  namespace: litmus
spec:
  template:
    metadata:
      name: litmus
      labels:
        app: litmus-jiva-openebs-ns

    spec:
      serviceAccountName: litmus
      restartPolicy: Never
      containers:
      - name: ansibletest
        image: openebs/ansible-runner:ci
        imagePullPolicy: Always

        env:
          - name: ANSIBLE_STDOUT_CALLBACK
            value: default

            # Application namespace
          - name: APP_NAMESPACE
            value: jiva-openebs-ns

          - name: PROVIDER_STORAGE_CLASS
            value: jiva-openebs-ns

            # Application pvc
          - name: APP_PVC
            value: openebs-busybox

          - name: APP_LABEL
            value: 'app=busybox-jiva'

          - name: PV_CAPACITY
            value: 5G

            # Use 'deprovision' for app-clean up
          - name: ACTION
            value: provision

            #Target namespace
          - name: OPERATOR_NS
            value: openebs

        command: ["/bin/bash"]
        args: ["-c", "ansible-playbook ./experiments/functional/jiva-pods-openebs-ns/test.yml -i /etc/ansible/hosts -vv; exit 0"]