From 45a5c1337b777f34c06d2ce99931414ba9f57ecd Mon Sep 17 00:00:00 2001 From: Clement Delafargue Date: Wed, 1 Jul 2020 11:48:04 +0200 Subject: Add support for linking service dependencies --- tasks/deploy.yml | 6 ++++++ tasks/service-dep.yml | 17 +++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 tasks/service-dep.yml (limited to 'tasks') diff --git a/tasks/deploy.yml b/tasks/deploy.yml index ae11921..8dda5e0 100644 --- a/tasks/deploy.yml +++ b/tasks/deploy.yml @@ -38,6 +38,12 @@ MIN_FLAVOR: "{{ clever_scaling.flavor.min | default('') }}" MAX_FLAVOR: "{{ clever_scaling.flavor.max | default('') }}" +- name: Configure service dependencies + include_tasks: service-dep.yml + vars: + service_dep: "{{ item }}" + with_items: "{{ clever_service_dependencies }}" + - name: Push Environment shell: "clever env import --json < {{ clever_app_confdir }}/env" args: diff --git a/tasks/service-dep.yml b/tasks/service-dep.yml new file mode 100644 index 0000000..67621f6 --- /dev/null +++ b/tasks/service-dep.yml @@ -0,0 +1,17 @@ +- name: Make sure addon {{ service_dep.addon_id }} is linked + shell: > + clever service link-addon {{ service_dep.addon_id }} + args: + chdir: "{{ clever_app_root }}" + environment: + CONFIGURATION_FILE: "{{ clever_login_file }}" + when: service_dep.addon_id is defined + +- name: Make sure app {{ service_dep.app_id }} is linked + shell: > + clever service link-app {{ service_dep.app_id }} + args: + chdir: "{{ clever_app_root }}" + environment: + CONFIGURATION_FILE: "{{ clever_login_file }}" + when: service_dep.app_id is defined -- cgit v1.2.3 From 3d3287e0767d13b0a81e5936ce9376d58f42e34c Mon Sep 17 00:00:00 2001 From: Clement Delafargue Date: Wed, 1 Jul 2020 11:49:27 +0200 Subject: Remove compatibility code for now-unsupported clever-tools versions --- tasks/addon.yml | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'tasks') diff --git a/tasks/addon.yml b/tasks/addon.yml index 328664d..1ee8eff 100644 --- a/tasks/addon.yml +++ b/tasks/addon.yml @@ -1,18 +1,4 @@ -- name: Gather addon information for {{ addon.name }} (clever --version < 1.5.0) - shell: > - set -o pipefail && - clever env | grep {{ addon.env_prefix }} - | sed -e 's/{{ addon.env_prefix }}_//' -e 's/=/: \"/' -e 's/$/\"/' - > {{ clever_app_confdir }}/{{ addon.name }}_env.yml - args: - chdir: "{{ clever_app_root }}" - executable: "bash" - environment: - CONFIGURATION_FILE: "{{ clever_login_file }}" - changed_when: False - when: clever_returned_version.stdout is version('1.5.0', '<') - -- name: Gather addon information for {{ addon.name }} (clever --version >= 1.5.0) +- name: Gather addon information for {{ addon.name }} shell: > set -o pipefail && clever env | grep {{ addon.env_prefix }} @@ -24,7 +10,6 @@ environment: CONFIGURATION_FILE: "{{ clever_login_file }}" changed_when: False - when: clever_returned_version.stdout is version('1.5.0', '>=') - name: Include addon var for {{ addon.name }} include_vars: -- cgit v1.2.3