---
apiVersion: batch/v1
kind: Job
metadata:
  generateName: cstor-storage-policies-
  namespace: litmus
spec:
  template:
    metadata:
      name: litmus
      labels:
        app: cstor-storage-policy

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

        env:
          - name: ANSIBLE_STDOUT_CALLBACK
            #value: log_plays, actionable, default
            value: default

            # Provide name POOL_NAME for the cstor-pool [SPC NAME]
          - name: POOL_NAME
            value: cstor-sparse-pool

          - name: POOL_TYPE
            value: spc
            
            # The path where the local pv can be created
          - name: POOL_PATH
            value: "/var/openebs/local"

          - name: QUEUE_DEPTH
            value: "20"

          - name: LU_WORKER
            value: "10"

          - name: ZVOL_WORKER
            value: "4"

            ## two values: create and delete 
          - name: ACTION
            value: create

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