packages: Fix service start on first boot

The *install-packages.service* unit has to be enabled, and the condition
checking for `/etc/ignition/packages.installed` was inverted.
Sending standard output to the console as well as the journal allows
watching progress.
master
Dustin 2024-01-06 19:41:07 -06:00
parent 1cdd12454f
commit 9d941a9985
2 changed files with 9 additions and 2 deletions

View File

@ -1,17 +1,19 @@
# vim: set ft=systemd :
[Unit]
Description=Install collectd
Description=Install additional packages
After=network-online.target
Wants=network-online.target
Before=zincati.service
Before=systemd-user-sessions.service
ConditionPathExists=/etc/ignition/packages.d
ConditionPathExists=/etc/ignition/packages.installed
ConditionPathExists=!/etc/ignition/packages.installed
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/sh /etc/ignition/install-packages.sh
ExecStartPost=/bin/touch /etc/ignition/packages.installed
StandardOutput=journal+console
[Install]
WantedBy=multi-user.target

View File

@ -14,3 +14,8 @@ storage:
mode: 0644
contents:
local: install-packages.service
systemd:
units:
- name: install-packages.service
enabled: true