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

    spec:
      serviceAccountName: litmus
      restartPolicy: Never
      containers:
      - name: ansibletest
        image: vvibhr995/dis-red:W1
        imagePullPolicy: Always
        env: 
          - name: ANSIBLE_STDOUT_CALLBACK
            #value: log_plays
            value: default

          - name: LOADGEN_NS
            value: app-redis-ns

          - name: LOADGEN_LABEL
            value: 'loadgen=redis-loadgen'

          - name: APPLICATION_LABEL
            value: 'app=redis'

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