Merge pull request #783 from drebes/cos-fixes

fix service unit indent on cloud-config-container module
This commit is contained in:
Roberto Jung Drebes 2022-08-24 09:38:48 +02:00 committed by GitHub
commit 83ffeaa1b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 12 deletions

View File

@ -44,26 +44,26 @@ write_files:
After=gcr-online.target docker.socket
Wants=gcr-online.target docker.socket docker-events-collector.service
[Service]
%{ if authenticate_gcr && length(users) > 0 ~}
%{~ if authenticate_gcr && length(users) > 0 ~}
Environment="HOME=/home/${users[0].username}"
ExecStartPre=/usr/bin/docker-credential-gcr configure-docker
%{ endif ~}
ExecStart=/usr/bin/docker run --rm --name=${container_name} \
%{ if length(users) > 0 ~}
%{~ endif ~}
ExecStart=/usr/bin/docker run --rm --name=${container_name} \
%{~ if length(users) > 0 ~}
--user=${users[0].uid} \
%{ endif ~}
%{~ if docker_logging ~}
%{~ endif ~}
%{~ if docker_logging ~}
--log-driver=gcplogs \
%{~ endif ~}
%{~ if docker_args != null ~}
%{~ endif ~}
%{~ if docker_args != null ~}
${docker_args} \
%{~ endif ~}
%{ for volume in container_volumes ~}
%{~ endif ~}
%{~ for volume in container_volumes ~}
-v ${volume.host}:${volume.container} \
%{ endfor ~}
%{~ endfor ~}
${container_image} ${container_args}
ExecStop=/usr/bin/docker stop ${container_name}
%{ for path, data in files ~}
%{ for path, data in files ~}
- path: ${path}
owner: ${lookup(data, "owner", "root")}
permissions: ${lookup(data, "permissions", "0644")}