---
apiVersion: batch/v1
kind: Job
metadata:
  generateName: litmus-zfspv-provision-
  namespace: litmus
spec:
  template:
    metadata:
      name: litmus
      labels:
        name: openebs-zfspv-provision
    spec:
      serviceAccountName: litmus
      restartPolicy: Never
      containers:
      - name: ansibletest
        image: openebs/ansible-runner:ci
        imagePullPolicy: IfNotPresent
        env:
          - name: ANSIBLE_STDOUT_CALLBACK
            #value: log_plays
            value: default

            ## Give the versioned branch name for zfs_localPV provisioner from openebs/zfs-localpv repo
            ## for e.g. (v0.4.x , v0.5.x  OR  master)
          - name: ZFS_BRANCH  
            value: ''

            ## Provide openebs ZFS_DRIVER image. To use ci images use ci tag.
            ## Give full image name (for e.g. quay.io/openebs/zfs-driver:<tag>)
            ## For versioned branch (other than master) leave this empty
            ## This env will be used only when master branch is used with custom-images or tags other than ci
          - name: ZFS_DRIVER_IMAGE
            value: ''

            ## Storage class will be created with the name provided here
          - name: STORAGE_CLASS  
            value: ''

            ## provide the ZPOOL name to be created  
          - name: POOL_NAME
            value: ''

          - name: POOL_TYPE  ## (striped or mirrored)
            value: ''

          - name: ACTION  ##(provision or deprovision)
            value: ''

          - name: COMPRESSION ## If data compression is needed give value: 'on' else give 'off'
            value: ''

          - name: DEDUP ## If data duplication is needed give value: 'on' else give 'off'
            value: ''

            ## In case of xfs and ext file system ; to create ZVOL provide the blocksize with which you want to create the block device
          - name: VOLBLOCKSIZE 
            value: ''

            ## In case of zfs file system provide recordsize which is the maximum block size for files and will be used to create ZFS datasets
          - name: RECORDSIZE
            value: ''

          - name: SNAPSHOT_CLASS  ## Snapshot class will be created with name which will be provided here
            value: ''

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