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

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

        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: OPENEBS_NAMESPACE
            value: 'openebs'

            # Name of snapshot
          - name: snapshot
            value: snapshot-busybox

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

