summaryrefslogtreecommitdiff
path: root/systemd/cloud-init-local.service.tmpl
blob: bf6b29617338e5c67010c2f864df386ac7269849 (plain)
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
34
35
## template:jinja
[Unit]
Description=Initial cloud-init job (pre-networking)
{% if variant in ["ubuntu", "unknown", "debian"] %}
DefaultDependencies=no
{% endif %}
Wants=network-pre.target
After=systemd-remount-fs.service
Before=NetworkManager.service
Before=network-pre.target
Before=shutdown.target
{% if variant in ["ubuntu", "unknown", "debian"] %}
Before=sysinit.target
Conflicts=shutdown.target
{% endif %}
{% if variant in ["suse"] %}
# Other distros use Before=sysinit.target. There is not a clearly identified
# reason for usage of basic.target instead.
Before=basic.target
Conflicts=shutdown.target
{% endif %}
RequiresMountsFor=/var/lib/cloud

[Service]
Type=oneshot
ExecStart=/usr/bin/cloud-init init --local
ExecStart=/bin/touch /run/cloud-init/network-config-ready
RemainAfterExit=yes
TimeoutSec=0

# Output needs to appear in instance console output
StandardOutput=journal+console

[Install]
WantedBy=cloud-init.target