---
apiVersion: batch/v1
kind: Job
metadata:
  generateName: litmus-nfs-provision-
  namespace: litmus
spec:
  template:
    metadata:
      name: litmus
      labels:
        app: nfs-litmus
    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

          - name: PROVIDER_STORAGE_CLASS
            value: openebs-cstor-disk

          - name: APP_PVC
            value: nfs-pvc-claim

          - name: APP_LABEL
            value: app=nfs

          - name: APP_NAMESPACE
            value: app-nfs-ns
            
            #Persistent Volume storage capacity
          - name: PV_CAPACITY
            value: 50G

          - name: NFS_STORAGE_CLASS_NAME
            value: openebs-nfs
         
            # NFS storage class Mount options
            # Supported values 3.x and 4.x
          - name: NFS_VERSION
            value: vers=4.1
            
          # Use 'deprovision' for clean up
          - name: ACTION
            value: provision

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