xoxys.droneci_autoscaler/templates/services/userdata.yml.j2

62 lines
2.1 KiB
Plaintext
Raw Normal View History

2020-09-30 19:56:00 +00:00
#jinja2: lstrip_blocks: True
#cloud-config
apt_reboot_if_required: false
package_update: true
package_upgrade: {{ droneci_autoscaler_agent_package_upgrade | bool | lower }}
{% if inst.agent_architecture | default(droneci_autoscaler_agent_architecture) == "arm" %}
bootcmd:
- [ dpkg, --add-architecture, armhf ]
{% endif %}
apt:
sources:
docker.list:
source: deb [arch={% if inst.agent_architecture | default(droneci_autoscaler_agent_architecture) == "arm" %}armhf{% elif inst.agent_architecture | default(droneci_autoscaler_agent_architecture) == "arm64" %}arm64{% else %}amd64{% endif %}] https://download.docker.com/linux/ubuntu $RELEASE stable
keyid: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88
packages:
- bridge-utils
- 'docker-ce{{ ':armhf' if inst.agent_architecture | default(droneci_autoscaler_agent_architecture) == "arm" else '' }}'
write_files:
- path: /etc/systemd/system/docker.service.d/override.conf
content: |
[Service]
ExecStart=
ExecStart={% if inst.agent_architecture | default(droneci_autoscaler_agent_architecture) == "arm" %}/usr/bin/setarch linux32 -B {% endif %}/usr/bin/dockerd
- path: /etc/systemd/system/containerd.service.d/override.conf
content: |
[Service]
ExecStart=
ExecStart={% if inst.agent_architecture | default(droneci_autoscaler_agent_architecture) == "arm" %}/usr/bin/setarch linux32 -B {% endif %}/usr/bin/containerd
- path: /etc/default/docker
content: |
DOCKER_OPTS=""
- path: /etc/docker/daemon.json
content: |
{
"hosts": ["0.0.0.0:2376", "unix:///var/run/docker.sock"],
"tls": true,
"tlsverify": true,
"tlscacert": "/etc/docker/ca.pem",
"tlscert": "/etc/docker/server-cert.pem",
"tlskey": "/etc/docker/server-key.pem"
}
- path: /etc/docker/ca.pem
encoding: b64
content: {% raw %}{{ .CACert | base64 }}{% endraw %}
- path: /etc/docker/server-cert.pem
encoding: b64
content: {% raw %}{{ .TLSCert | base64 }}{% endraw %}
- path: /etc/docker/server-key.pem
encoding: b64
content: {% raw %}{{ .TLSKey | base64 }}{% endraw %}