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

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

        env:
          - name: ANSIBLE_STDOUT_CALLBACK
            value: default
            
            # Application pvc
          - name: APP_PVC
            value: openebs-busybox

            # Application namespace
          - name: APP_NAMESPACE
            value: app-busybox-ns

          - name: PROVIDER_STORAGE_CLASS
            value: openebs-snapshot-promoter

            # Name of clone volume
          - name: CLONE_VOL_CLAIM
            value: clone-busybox

          - name: SNAPSHOT
            value: snapshot-busybox

          - name: CAPACITY
            value: 5G

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