Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
cdist
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
37
Issues
37
List
Boards
Labels
Service Desk
Milestones
Merge Requests
10
Merge Requests
10
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ungleich-public
cdist
Commits
e1b80f72
Commit
e1b80f72
authored
Feb 23, 2020
by
Darko Poljak
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'service' into 'master'
Add simple __service type See merge request
ungleich-public/cdist!847
parents
2a5309b4
09540dc6
Pipeline
#931
passed with stage
in 57 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
84 additions
and
0 deletions
+84
-0
cdist/conf/type/__service/explorer/service-manager
cdist/conf/type/__service/explorer/service-manager
+8
-0
cdist/conf/type/__service/gencode-remote
cdist/conf/type/__service/gencode-remote
+9
-0
cdist/conf/type/__service/man.rst
cdist/conf/type/__service/man.rst
+51
-0
cdist/conf/type/__service/manifest
cdist/conf/type/__service/manifest
+15
-0
cdist/conf/type/__service/parameter/required
cdist/conf/type/__service/parameter/required
+1
-0
No files found.
cdist/conf/type/__service/explorer/service-manager
0 → 100755
View file @
e1b80f72
#!/bin/sh
# Assume systemd if systemctl is in PATH.
if
[
"
$(
command
-v
systemctl
)
"
]
;
then
printf
"systemd"
else
printf
"unknown"
fi
cdist/conf/type/__service/gencode-remote
0 → 100755
View file @
e1b80f72
#!/bin/sh
manager
=
"
$(
cat
"
$__object
/explorer/service-manager"
)
"
name
=
$__object_id
action
=
"
$(
cat
"
$__object
/parameter/action"
)
"
if
[
"
$manager
"
=
"unknown"
]
;
then
echo
"service '
$name
' '
$action
'"
fi
cdist/conf/type/__service/man.rst
0 → 100644
View file @
e1b80f72
cdist-type__service(7)
======================
NAME
----
cdist-type__service - Run action on a system service
DESCRIPTION
-----------
This type allows you to run an action against a system service.
REQUIRED PARAMETERS
-------------------
action
Arbitrary parameter passed as action. Usually 'start', 'stop', 'reload' or 'restart'.
OPTIONAL PARAMETERS
-------------------
None.
BOOLEAN PARAMETERS
------------------
None.
EXAMPLES
--------
.. code-block:: sh
# Restart nginx service.
__service nginx --action restart
# Stop postfix service.
__service postfix --action stop
AUTHORS
-------
Timothée Floure <timothee.floure@ungleich.ch>
COPYING
-------
Copyright \(C) 2019 Timothée Floure. You can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
cdist/conf/type/__service/manifest
0 → 100644
View file @
e1b80f72
#!/bin/sh
manager
=
"
$(
cat
"
$__object
/explorer/service-manager"
)
"
name
=
$__object_id
action
=
"
$(
cat
"
$__object
/parameter/action"
)
"
case
"
$manager
"
in
systemd
)
__systemd_service
"
$name
"
--action
"
$action
"
;;
*
)
# Unknown: handled by `service $NAME $action` in gencode-remote.
;;
esac
cdist/conf/type/__service/parameter/required
0 → 100644
View file @
e1b80f72
action
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment