stages/systemd:support for user service dropin

systemd unit stage will now be able to add user unit dropin,
this is done by adding an additional field:unit-type
which is set to system by default. It also adds ability
to update the unit config with ConditionPathExists.
Relevant testing updated for the new workflow.

Signed-off-by: Sayan Paul <paul.sayan@gmail.com>
This commit is contained in:
Sayan Paul 2023-08-08 09:56:04 -04:00 committed by Tomáš Hozza
parent ed926ecc71
commit 61da6124ed
4 changed files with 46 additions and 2 deletions

View file

@ -470,6 +470,19 @@
}
}
}
},
{
"name": "org.osbuild.systemd.unit",
"options": {
"unit": "grub-boot-success.timer",
"dropin": "10-disable-if-greenboot.conf",
"unit-type": "global",
"config": {
"Unit": {
"ConditionPathExists": "/usr/lib/greenboot/greenboot"
}
}
}
}
]
},

View file

@ -26,3 +26,11 @@ pipeline:
config:
Service:
Environment: NM_CLOUD_SETUP_EC2=yes
- name: org.osbuild.systemd.unit
options:
unit: grub-boot-success.timer
dropin: 10-disable-if-greenboot.conf
unit-type: global
config:
Unit:
ConditionPathExists: /usr/lib/greenboot/greenboot

View file

@ -1,7 +1,9 @@
{
"added_files": [
"/usr/lib/systemd/system/nm-cloud-setup.service.d",
"/usr/lib/systemd/system/nm-cloud-setup.service.d/10-rh-enable-for-ec2.conf"
"/usr/lib/systemd/system/nm-cloud-setup.service.d/10-rh-enable-for-ec2.conf",
"/usr/lib/systemd/user/grub-boot-success.timer.d",
"/usr/lib/systemd/user/grub-boot-success.timer.d/10-disable-if-greenboot.conf"
],
"deleted_files": [],
"differences": {}