38 lines
1.3 KiB
YAML
38 lines
1.3 KiB
YAML
#cloud-config
|
|
|
|
write_files:
|
|
- path: /root/overrides.list
|
|
permission: '0644'
|
|
content: |
|
|
REALM={{ realm }}
|
|
TOKEN={{ token }}
|
|
ENDPOINT=wss://buildman.quay.io:8787
|
|
|
|
coreos:
|
|
update:
|
|
reboot-strategy: off
|
|
group: {{ coreos_channel }}
|
|
|
|
etcd:
|
|
discovery: https://discovery.etcd.io/{{ etcd_token }}
|
|
# multi-region and multi-cloud deployments need to use $public_ipv4
|
|
addr: $private_ipv4:4001
|
|
peer-addr: $private_ipv4:7001
|
|
|
|
units:
|
|
- name: quay-builder.service
|
|
command: start
|
|
content: |
|
|
[Unit]
|
|
Description=Quay builder container
|
|
Author=Jake Moshenko
|
|
After=docker.service
|
|
|
|
[Service]
|
|
TimeoutStartSec=600
|
|
TimeoutStopSec=2000
|
|
ExecStartPre=/usr/bin/sudo /bin/sh -xc "echo '{{ manager_ip }} buildman.quay.io' >> /etc/hosts; exit 0"
|
|
ExecStartPre=/usr/bin/docker login -u {{ quay_username }} -p {{ quay_password }} -e unused quay.io
|
|
ExecStart=/usr/bin/docker run --rm --net=host --name quay-builder --privileged --env-file /root/overrides.list -v /var/run/docker.sock:/var/run/docker.sock quay.io/coreos/registry-build-worker:latest
|
|
ExecStop=/usr/bin/docker stop quay-builder
|
|
ExecStopPost=/usr/bin/sudo /bin/sh -xc "/bin/sleep 600; /sbin/shutown -h now"
|