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

          - name: APP_NAMESPACE
            value: app-percona-ns 

          - name: TARGET_NAMESPACE
            value: openebs

          - name: APP_LABEL
            value: 'name=percona'

          - name: APP_PVC
            value: percona-mysql-claim

          - name: LIVENESS_APP_LABEL
            value: ""

          - name: LIVENESS_APP_NAMESPACE
            value: ""

          - name: DATA_PERSISTENCY
            value: ""            

            # CHOS_TYPE values :  target-zrepl-kill , target-kill , target-delete 
          - name: CHAOS_TYPE
            value: "target-zrepl-kill"
            
            # TARGET_CONTAINER values: cstor-volume-mgmt , cstor-istgt
          - name: TARGET_CONTAINER
            value: "cstor-volume-mgmt"

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

