---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: ansible
spec:
  replicas: 1
  selector:
    matchLabels:
      name: ansible
  template:
    metadata:
      labels:
        name: ansible
    spec:
      serviceAccountName: ansible
      containers:
        - name: operator
          # Replace this with the built image name
          image: "{{ image }}"
          imagePullPolicy: "{{ pull_policy }}"
          volumeMounts:
          - mountPath: /tmp/ansible-operator/runner
            name: runner
          env:
            - name: WATCH_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: OPERATOR_NAME
              value: "ansible"
            - name: ANSIBLE_GATHERING
              value: explicit
            - name: ANSIBLE_INVENTORY
              value: /opt/ansible/inventory
      volumes:
        - name: runner
          emptyDir: {}
