stages: extend org.osbuild.systemd to create .service unit drop-ins

Extend the `org.osbuild.systemd` stage to create drop-in configuration
files for Systemd `.service` units under `/usr/lib/systemd/system`.
Currently only the `Environment` option in the `Service` section can be
configured.

Update the `org.osbuild.systemd` stage test case to create drop-in
configuration `10-rh-enable-for-ec2.conf` for `nm-cloud-setup.service`
unit, as used in RHEL AMI images.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
This commit is contained in:
Tomas Hozza 2021-06-09 18:12:56 +02:00 committed by Tomas Hozza
parent 7765c53ecc
commit 1fef6e76fb
4 changed files with 100 additions and 8 deletions

View file

@ -456,7 +456,16 @@
],
"disabled_services": [
"sshd"
]
],
"unit_dropins": {
"nm-cloud-setup.service": {
"10-rh-enable-for-ec2.conf": {
"Service": {
"Environment": "NM_CLOUD_SETUP_EC2=yes"
}
}
}
}
}
}
]

View file

@ -42,7 +42,16 @@
],
"disabled_services": [
"sshd"
]
],
"unit_dropins": {
"nm-cloud-setup.service": {
"10-rh-enable-for-ec2.conf": {
"Service": {
"Environment": "NM_CLOUD_SETUP_EC2=yes"
}
}
}
}
}
}
]

View file

@ -1,7 +1,9 @@
{
"added_files": [
"/etc/systemd/system/ldconfig.service",
"/etc/systemd/system/multi-user.target.wants/nftables.service"
"/etc/systemd/system/multi-user.target.wants/nftables.service",
"/usr/lib/systemd/system/nm-cloud-setup.service.d",
"/usr/lib/systemd/system/nm-cloud-setup.service.d/10-rh-enable-for-ec2.conf"
],
"deleted_files": [
"/etc/systemd/system/multi-user.target.wants/sshd.service"