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

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

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

          - name: PROVIDER_STORAGE_CLASS
            # Supported values: openebs-standard, local-storage,openebs-standalone
            value: openebs-standalone

            # Application pvc
          - name: APP_PVC
            value: openebs-redis

            # Application label
          - name: APP_LABEL
            value: 'app=redis'

            # Application namespace
          - name: APP_NAMESPACE
            value: app-redis-ns

            # Supported values: Deployment ,statefulset.
          - name: DEPLOY_TYPE
            value: statefulset

          - name: APP_REPLICA
            value: 'replicas=3'

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