---
version: 3

images:
  base_image:
    name: {{ ee_base_image }}

dependencies:
  # Use python3
  python_interpreter:
    package_system: python3
    python_path: /usr/bin/python3

  ansible_core:
    package_pip: ansible-core

  ansible_runner:
    package_pip: ansible-runner
{%- if ee_system_packages %}

  system:
{%- for pkg in ee_system_packages %}
    - {{ pkg }}
{%- endfor %}
{%- endif %}
{%- if ee_python_deps %}

  python:
{%- for dep in ee_python_deps %}
    - {{ dep }}
{%- endfor %}
{%- endif %}
{%- if ee_collections %}

  galaxy:
    collections:
{%- for col in ee_collections %}
      - name: {{ col.name }}
{%- if col.version is defined %}
        version: "{{ col.version }}"
{%- endif %}
{%- if col.type is defined %}
        type: {{ col.type }}
{%- endif %}
{%- if col.source is defined %}
        source: {{ col.source }}
{%- endif %}
{%- endfor %}
{%- endif %}
{%- if ee_additional_build_files %}

additional_build_files:
{%- for file in ee_additional_build_files %}
  - src: {{ file.src }}
    dest: {{ file.dest }}
{%- endfor %}
{%- endif %}

additional_build_steps:
{%- if ee_additional_build_steps.prepend_base is defined %}
  prepend_base:
{%- for step in ee_additional_build_steps.prepend_base %}
    - {{ step }}
{%- endfor %}
{%- endif %}
  append_base:
    - RUN $PYCMD -m pip install -U pip
{%- if ee_additional_build_steps.append_base is defined %}
{%- for step in ee_additional_build_steps.append_base %}
    - {{ step }}
{%- endfor %}
{%- endif %}
{%- if ee_additional_build_steps.prepend_final is defined %}
  prepend_final:
{%- for step in ee_additional_build_steps.prepend_final %}
    - {{ step }}
{%- endfor %}
{%- endif %}
{%- if ee_additional_build_steps.append_final is defined %}
  append_final:
{%- for step in ee_additional_build_steps.append_final %}
    - {{ step }}
{%- endfor %}
{%- endif %}

options:
{%- if ee_options.package_manager_path is defined %}
  package_manager_path: {{ ee_options.package_manager_path }}
{%- endif %}
  tags:
    - {{ ee_name }}
