---
apiVersion: batch/v1
kind: Job
metadata:
  generateName: litmus-cstor-operator-
  namespace: litmus
spec:
  template:
    metadata:
      name: litmus
      labels: 
        provider: cstor-operator
    spec:
      serviceAccountName: litmus
      restartPolicy: Never
      containers:
      - name: ansibletest
        image: openebs/ansible-runner:ci
        imagePullPolicy: Always
        env: 
          - name: ANSIBLE_STDOUT_CALLBACK
            value: default

            # Image tag for cstor cspc components
          - name: IMAGE_TAG
            value: ""

            # release version in case of ci, value is 'master'
            # Other Release versions it should be 1.x.x for ex 1.12.0
          - name: RELEASE_VERSION
            value: ""

            ## openebs charts branch to get the operator specs
          - name: RELEASE_BRANCH
            value: "gh-pages"

          - name: ACTION
            value: provision

            ## Admission server policy
            #supported values are 'fail' or 'ignore'
          - name: WEBHOOK_FAILURE_POLICY
            value: "ignore"

            # Namespace where the csi plugins are deployed
            # For versions 1.10.0, 1.11.0 and 1.12.0 namespace is 'kube-system`
          - name: CSI_NS
            value: "openebs"

            # NODE_OS is required in case of the image_tag is >2.x.x
          - name: NODE_OS
            value: ""

          - name: SNAPSHOT_CLASS
            value: csi-cstor                                    

        command: ["/bin/bash"]
        args: ["-c", "ansible-playbook ./providers/cstor-operator/test.yml -i /etc/ansible/hosts -vv; exit 0"]
