From 1538f7b2718c5f14533b9c995798a82d32d5047a Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Wed, 30 Sep 2020 23:21:16 +0200 Subject: [PATCH] fix ssh key deployment --- tasks/setup.yml | 4 ++-- templates/services/droneci_autoscaler_compose.yml.j2 | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tasks/setup.yml b/tasks/setup.yml index 56f6f8c..e510f89 100644 --- a/tasks/setup.yml +++ b/tasks/setup.yml @@ -25,10 +25,10 @@ - name: Write SSH private key copy: - content: "{{ inst.sshkey | default(droneci_autoscaler_sshkey) }}" + content: "{{ __droneci_autoscaler_sshkey }}" dest: "{{ __droneci_autoscaler_workdir }}/ssh_key" mode: 0600 - when: __droneci_autoscaler_sshkey + when: __droneci_autoscaler_sshkey | bool no_log: True - name: Generate SSH key pair if missing diff --git a/templates/services/droneci_autoscaler_compose.yml.j2 b/templates/services/droneci_autoscaler_compose.yml.j2 index 7a64ead..f579b75 100644 --- a/templates/services/droneci_autoscaler_compose.yml.j2 +++ b/templates/services/droneci_autoscaler_compose.yml.j2 @@ -69,7 +69,6 @@ services: {% if droneci_autoscaler_memory_reservation is defined %} mem_reservation: {{ droneci_autoscaler_memory_reservation }} {% endif %} -{% if droneci_autoscaler_networks | default([]) | length > 0 %} {% if droneci_autoscaler_volumes | default([]) | rejectattr("bind") | list | length > 0 %} volumes: @@ -77,6 +76,8 @@ volumes: {{ volume.name }}: {% endfor %} {% endif %} +{% if droneci_autoscaler_networks | default([]) | length > 0 %} + networks: {% for network in droneci_autoscaler_networks %} {{ network.name }}: