---
apiVersion: batch/v1
kind: Job
metadata:
  generateName: change-role-negative-check
  namespace: litmus
spec:
  template:
    metadata:
      name: litmus
      labels:
        app: change-role-negative-check-litmus
    spec:
      serviceAccountName: litmus
      restartPolicy: Never
      volumes:
      - name: secret-volume
        secret:
          secretName: director-user-pass
      containers:
      - name: ansibletest
        image: mayadataio/dop-validator:ci
        imagePullPolicy: Always
        volumeMounts:
        - name: secret-volume
          readOnly: true
          mountPath: "/etc/secret-volume"
        env:
          - name: DIRECTOR_IP
            valueFrom:
              configMapKeyRef:
                name: config
                key: url
          - name: GROUP_ID
            valueFrom:
              configMapKeyRef:
                name: groupid
                key: group_id
          - name: ANSIBLE_STDOUT_CALLBACK
            value: default  
          - name: MEMBER_EMAIL_ID
            value: "oep.member@mayadata.io"
          - name: SELF_EMAIL_ID
            value: "oep.user@mayadata.io"
        command: ["/bin/bash"]
        args: ["-c", "ansible-playbook ./litmus/director/change-role-negative/test.yaml -i /etc/ansible/hosts -v; exit 0"]
      imagePullSecrets:
      - name: oep-secret