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:
parent
f9e35c25da
commit
e858dc72c3
6 changed files with 2388 additions and 0 deletions
1043
test/data/stages/systemd.unit.create/a.json
Normal file
1043
test/data/stages/systemd.unit.create/a.json
Normal file
File diff suppressed because it is too large
Load diff
31
test/data/stages/systemd.unit.create/a.mpp.yaml
Normal file
31
test/data/stages/systemd.unit.create/a.mpp.yaml
Normal 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
|
||||
1074
test/data/stages/systemd.unit.create/b.json
Normal file
1074
test/data/stages/systemd.unit.create/b.json
Normal file
File diff suppressed because it is too large
Load diff
52
test/data/stages/systemd.unit.create/b.mpp.yaml
Normal file
52
test/data/stages/systemd.unit.create/b.mpp.yaml
Normal 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
|
||||
7
test/data/stages/systemd.unit.create/diff.json
Normal file
7
test/data/stages/systemd.unit.create/diff.json
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"added_files": [
|
||||
"/usr/lib/systemd/system/create-directory.service"
|
||||
],
|
||||
"deleted_files": [],
|
||||
"differences": {}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue