stage/systemd-unit:stage to create systemd unit file

Add systemd unit files in osbuild stage

This stage creates systemd unit file in `/usr/lib/systemd/system/`.
The stage accepts filename which must end with `.service`.Section
`Unit` , `Service` , `Install` accepts various parameters as per
the systemd documentaion.`systemd-analyze verify` is be performed
after the .service file is created to check for potential errors.

Signed-off-by: Sayan Paul <paul.sayan@gmail.com>
This commit is contained in:
Sayan Paul 2024-02-08 15:26:28 +05:30 committed by Michael Vogt
parent f9e35c25da
commit e858dc72c3
6 changed files with 2388 additions and 0 deletions

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,31 @@
version: '2'
pipelines:
- mpp-import-pipelines:
path: ../manifests/fedora-vars.ipp.yaml
- mpp-import-pipeline:
path: ../manifests/fedora-build-v2.ipp.yaml
id: build
runner:
mpp-format-string: org.osbuild.fedora{release}
- name: tree
build: name:build
stages:
- type: org.osbuild.rpm
inputs:
packages:
type: org.osbuild.files
origin: org.osbuild.source
mpp-depsolve:
architecture: $arch
module-platform-id: $module_platform_id
repos:
mpp-eval: repos
packages:
- nftables
- openssh-server
- systemd
options:
gpgkeys:
mpp-eval: gpgkeys
exclude:
docs: true

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,52 @@
version: '2'
pipelines:
- mpp-import-pipelines:
path: ../manifests/fedora-vars.ipp.yaml
- mpp-import-pipeline:
path: ../manifests/fedora-build-v2.ipp.yaml
id: build
runner:
mpp-format-string: org.osbuild.fedora{release}
- name: tree
build: name:build
stages:
- type: org.osbuild.rpm
inputs:
packages:
type: org.osbuild.files
origin: org.osbuild.source
mpp-depsolve:
architecture: $arch
module-platform-id: $module_platform_id
repos:
mpp-eval: repos
packages:
- nftables
- openssh-server
- systemd
options:
gpgkeys:
mpp-eval: gpgkeys
exclude:
docs: true
- type: org.osbuild.systemd.unit.create
options:
filename: create-directory.service
config:
Unit:
Description: Create directory
DefaultDependencies: false
ConditionPathExists:
- "|!/etc/myfile"
Service:
Type: "oneshot"
RemainAfterExit: true
ExecStart:
- mkdir -p /etc/mydir
- touch /etc/myfile
Install:
WantedBy:
- local-fs.target
RequiredBy:
- multi-user.target

View file

@ -0,0 +1,7 @@
{
"added_files": [
"/usr/lib/systemd/system/create-directory.service"
],
"deleted_files": [],
"differences": {}
}