homelab/packer/files/archlinux/root/etc/systemd/system/hcloud-hostname.service

12 lines
266 B
SYSTEMD
Raw Normal View History

2024-01-28 08:31:39 +00:00
[Unit]
Description=Import hcloud hostname
Requires=hcloud-dl-metadata.service
After=hcloud-dl-metadata.service
[Service]
Type=oneshot
ExecStart=/bin/sh -c 'hostnamectl set-hostname $(jq -r .hostname /etc/hcloud-metadata.json)'
[Install]
WantedBy=multi-user.target