Browse Source

update instance type

main
Markus Bergholz 2 months ago
parent
commit
d26a85dca4
Signed by: m GPG Key ID: B45724801354B174
1 changed files with 33 additions and 2 deletions
  1. +33
    -2
      roles/containers/tasks/autoscaler.yml

+ 33
- 2
roles/containers/tasks/autoscaler.yml View File

@ -10,9 +10,9 @@
notify:
- reload systemd
- name: add autoscaler script
- name: add hetzner drone autoscaler script
copy:
dest: "/opt/{{ THIS_SERVICE }}"
dest: "/opt/hetzner_drone_{{ THIS_SERVICE }}"
content: |
#!/bin/bash
docker run --rm --name {{ THIS_SERVICE }} \
@ -38,6 +38,37 @@
-e DRONE_POOL_MIN_AGE=45m \
drone/autoscaler:1.7.3
mode: +x
- name: add aws drone autoscaler script
copy:
dest: "/opt/{{ THIS_SERVICE }}"
content: |
#!/bin/bash
docker run --rm --name {{ THIS_SERVICE }} \
--detach=false \
--network osuv \
-v {{ DOCKER_DATA }}/drone_autoscaler:/data \
-e DRONE_GITEA_SERVER="https://git.osuv.de" \
-e DRONE_GITEA_CLIENT_ID="{{ CONFIG.GITEA_CLIENT_ID }}" \
-e DRONE_GITEA_CLIENT_SECRET="{{ CONFIG.GITEA_CLIENT_SECRET }}" \
-e DRONE_RPC_SECRET="{{ CONFIG.DRONE_RPC_SECRET }}" \
-e DRONE_SERVER_HOST=drone.osuv.de \
-e DRONE_SERVER_PROTO=https \
-e DRONE_SERVER_TOKEN="{{ CONFIG.DRONE_SERVER_TOKEN }}" \
-e DRONE_AGENT_TOKEN="{{ CONFIG.DRONE_AGENT_TOKEN }}" \
-e DRONE_POOL_MIN="0" \
-e DRONE_POOL_MAX="1" \
-e DRONE_AMAZON_INSTANCE=c5a.large \
-e DRONE_AMAZON_REGION=eu-central-1 \
-e DRONE_AMAZON_SUBNET_ID=subnet-d8309db2 \
-e DRONE_AMAZON_SECURITY_GROUP=sg-05c5806fe28d752a7 \
-e DRONE_AMAZON_SSHKEY=nuc \
-e AWS_ACCESS_KEY_ID={{ CONFIG.AWS_ACCESS_KEY_ID }} \
-e AWS_SECRET_ACCESS_KEY={{ CONFIG.AWS_SECRET_ACCESS_KEY }} \
-e DRONE_INTERVAL=60s \
-e DRONE_POOL_MIN_AGE=30m \
drone/autoscaler:1.7.3
mode: +x
register: myservice
notify:
- restart service


Loading…
Cancel
Save