templates/packer: set wanted-by to cloud-init.target

The `cloud-init.target` in 9.6 has `After=multi-user.target` in its unit
config. The worker initialization service was set to run before
`multi-user.target`, but after `cloud-final.service`. This created an
impossible situation and systemd just disabling the initialization
service.

So this changes:
`multi-user.target -> worker-*.service -> cloud-final.service -> multi-user.target`
to
`cloud-init.target -> worker-*.service -> cloud-final.service -> multi-user.target`.

Thus resolving the loop.
This commit is contained in:
Sanne Raymaekers 2025-05-14 17:26:07 +02:00
parent 92363cee22
commit c3cb3ba785
2 changed files with 2 additions and 2 deletions

View file

@ -10,4 +10,4 @@ ExecStart=/usr/local/libexec/worker-initialization-scripts/set_executor_hostname
ExecStart=/usr/local/libexec/worker-initialization-scripts/worker_executor.sh
[Install]
WantedBy=multi-user.target
WantedBy=cloud-init.target

View file

@ -24,4 +24,4 @@ ExecStart=/usr/local/libexec/worker-initialization-scripts/worker_service.sh
ExecStopPost=/usr/local/libexec/worker-initialization-scripts/on_exit.sh
[Install]
WantedBy=multi-user.target
WantedBy=cloud-init.target