2024-01-28 08:31:39 +00:00
|
|
|
[Unit]
|
|
|
|
Description=Import hcloud root ssh keys
|
|
|
|
Requires=hcloud-dl-metadata.service
|
|
|
|
After=hcloud-dl-metadata.service
|
|
|
|
ConditionPathExists=!/root/.ssh/authorized_keys
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
Type=oneshot
|
|
|
|
DynamicUser=yes
|
|
|
|
ExecStart=/usr/bin/jq -r '.ssh_keys|join("\n")' /etc/hcloud-metadata.json
|
2024-01-30 17:28:08 +00:00
|
|
|
StandardOutput=truncate:/home/ansible/.ssh/authorized_keys
|
2024-01-28 08:31:39 +00:00
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|