---
apiVersion: batch/v1
kind: Job
metadata:
  generateName: litmus-jenkins-
  namespace: litmus
spec:
  template:
    metadata:
      name: litmus
      labels:
        app: jenkins-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, actionable, default
            value: default

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

          - name: APP_PVC
            value: jenkins-claim

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

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

            # Use 'deprovision' for app-clean up
          - name: ACTION
            value: ''

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

