clever_login_file: "{{ clever_app_confdir }}/login"
clever_haskell_entry_point: "{{ clever_entry_point | default(None) }}"
+clever_haskell_env: {}
clever_env: {}
clever_disable_metrics: false
+- name: Setup haskell-specific environment variables
+ set_fact:
+ clever_haskell_env:
+ CC_RUN_COMMAND: "~/.local/bin/{{ clever_haskell_entry_point }}"
+ when: clever_haskell_entry_point is defined
+
+- name: Assemble full environment
+ set_fact:
+ clever_env: "{{ clever_base_env | combine(clever_haskell_env) | combine(clever_env) }}"
+
- name: Create environment file
template:
src: env.j2
-{% set static_env = clever_base_env | combine(clever_env) %}
-{% set dynamic_env = {} %}
-{% if clever_haskell_entry_point %}
-{# Haskell only #}
-{# https://www.clever-cloud.com/doc/get-help/reference-environment-variables/#haskell #}
-{% set dynamic_env = { 'CC_RUN_COMMAND': '~/.local/bin/' + clever_haskell_entry_point } %}
-{% endif %}
{# dict2items is not enough here, all the values have to be stringified #}
{# git-blame this line for more explanations #}
-{{ static_env | combine(dynamic_env) | json_env_map | to_json }}
+{{ clever_env | json_env_map | to_json }}