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 }}: