1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
.. _wait_for_cloud_init:
How to wait for cloud-init
**************************
It is useful to be able to wait until cloud-init has completed running prior
to doing some other task.
CLI
===
Cloud-init's command ``cloud-init status --wait`` will exit once cloud-init has
completed.
SystemD
=======
Systems using systemd may be configured to start a service after cloud-init
completes. This may be accomplished by including
``After=cloud-init.target multi-user.target`` in the unit file. For example:
.. code-block::
[Unit]
Description=Example service
After=cloud-init.target multi-user.target
[Service]
Type=oneshot
ExecStart=sh -c 'echo "Howdy partner 🤠"'
[Install]
WantedBy=multi-user.target
|