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

    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: LOADGEN_NS
            value: app-esearch-ns

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

          - name: APPLICATION_LABEL
            value: 'app=elasticsearch'

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