saltext.openrc 0.1.0__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- saltext/openrc/__init__.py +28 -0
- saltext/openrc/modules/__init__.py +0 -0
- saltext/openrc/modules/openrc.py +334 -0
- saltext/openrc/version.py +1 -0
- saltext_openrc-0.1.0.dist-info/METADATA +166 -0
- saltext_openrc-0.1.0.dist-info/RECORD +11 -0
- saltext_openrc-0.1.0.dist-info/WHEEL +6 -0
- saltext_openrc-0.1.0.dist-info/entry_points.txt +2 -0
- saltext_openrc-0.1.0.dist-info/licenses/LICENSE +201 -0
- saltext_openrc-0.1.0.dist-info/licenses/NOTICE +10 -0
- saltext_openrc-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# pylint: disable=missing-module-docstring
|
|
2
|
+
import pathlib
|
|
3
|
+
|
|
4
|
+
PACKAGE_ROOT = pathlib.Path(__file__).resolve().parent
|
|
5
|
+
try:
|
|
6
|
+
from .version import __version__
|
|
7
|
+
except ImportError: # pragma: no cover
|
|
8
|
+
__version__ = "0.0.0.not-installed"
|
|
9
|
+
try:
|
|
10
|
+
from importlib.metadata import version, PackageNotFoundError
|
|
11
|
+
|
|
12
|
+
try:
|
|
13
|
+
__version__ = version(__name__)
|
|
14
|
+
except PackageNotFoundError:
|
|
15
|
+
# package is not installed
|
|
16
|
+
pass
|
|
17
|
+
except ImportError:
|
|
18
|
+
try:
|
|
19
|
+
from pkg_resources import get_distribution, DistributionNotFound
|
|
20
|
+
|
|
21
|
+
try:
|
|
22
|
+
__version__ = get_distribution(__name__).version
|
|
23
|
+
except DistributionNotFound:
|
|
24
|
+
# package is not installed
|
|
25
|
+
pass
|
|
26
|
+
except ImportError:
|
|
27
|
+
# pkg resources isn't even available?!
|
|
28
|
+
pass
|
|
File without changes
|
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Service management via OpenRC.
|
|
3
|
+
|
|
4
|
+
This module registers under Salt's ``service`` virtual name and is loaded
|
|
5
|
+
automatically on minions where OpenRC manages services (Alpine, Gentoo,
|
|
6
|
+
Artix, and other OpenRC-based distributions). Existing states such as
|
|
7
|
+
``service.running`` and ``service.dead`` work without any changes to your
|
|
8
|
+
state files.
|
|
9
|
+
|
|
10
|
+
.. important::
|
|
11
|
+
If Salt is not using this module on an OpenRC minion (or you see an error
|
|
12
|
+
such as *'service.start' is not available*), see :ref:`here
|
|
13
|
+
<module-provider-override>`.
|
|
14
|
+
|
|
15
|
+
Runlevels
|
|
16
|
+
---------
|
|
17
|
+
|
|
18
|
+
OpenRC organises services into named runlevels rather than systemd targets.
|
|
19
|
+
The two runlevels relevant to most service management work are:
|
|
20
|
+
|
|
21
|
+
``default``
|
|
22
|
+
Services that should start when the system reaches a normal running state.
|
|
23
|
+
This is the runlevel used by :py:func:`enable` and :py:func:`disable` when
|
|
24
|
+
no ``runlevel`` argument is supplied.
|
|
25
|
+
|
|
26
|
+
``boot``
|
|
27
|
+
Services that must start earlier in the boot sequence, such as
|
|
28
|
+
``networking``, ``syslog``, and ``hostname``. To manage a service in this
|
|
29
|
+
runlevel, pass ``runlevel=boot`` explicitly.
|
|
30
|
+
|
|
31
|
+
Other runlevels (``sysinit``, ``shutdown``, ``nonetwork``) exist but are
|
|
32
|
+
rarely targeted directly by Salt states.
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
import logging
|
|
36
|
+
|
|
37
|
+
import salt.utils.path
|
|
38
|
+
from salt.exceptions import CommandExecutionError
|
|
39
|
+
|
|
40
|
+
log = logging.getLogger(__name__)
|
|
41
|
+
|
|
42
|
+
__virtualname__ = "service"
|
|
43
|
+
|
|
44
|
+
# The runlevel used by default for enable/disable operations.
|
|
45
|
+
# OpenRC systems use 'default' for services that should start at boot.
|
|
46
|
+
_DEFAULT_RUNLEVEL = "default"
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def __virtual__():
|
|
50
|
+
"""
|
|
51
|
+
Only load on systems where OpenRC is present.
|
|
52
|
+
|
|
53
|
+
OpenRC is detected by the presence of the ``rc-service`` command rather
|
|
54
|
+
than by matching a specific ``os_family``, so the module works on any
|
|
55
|
+
OpenRC-based distribution (Alpine, Gentoo, Artix, Devuan with OpenRC,
|
|
56
|
+
and so on).
|
|
57
|
+
|
|
58
|
+
.. note::
|
|
59
|
+
``rc-service`` being on ``PATH`` means the OpenRC tooling is installed,
|
|
60
|
+
which holds on every OpenRC-based system but does not by itself prove
|
|
61
|
+
OpenRC is managing services here (for example, a host where the
|
|
62
|
+
``openrc`` package was installed but never actually used). To guard
|
|
63
|
+
against that, additionally require the OpenRC runtime directory::
|
|
64
|
+
|
|
65
|
+
os.path.isdir("/run/openrc")
|
|
66
|
+
|
|
67
|
+
OpenRC creates it when it brings up its runlevels, so it reliably
|
|
68
|
+
signals OpenRC is in use regardless of what runs as PID 1 -- on Alpine
|
|
69
|
+
that is BusyBox init with OpenRC layered on top; on Gentoo it is OpenRC
|
|
70
|
+
itself.
|
|
71
|
+
"""
|
|
72
|
+
if salt.utils.path.which("rc-service") is None:
|
|
73
|
+
return (False, "The openrc execution module requires the 'rc-service' command")
|
|
74
|
+
return __virtualname__
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def _run(cmd):
|
|
78
|
+
"""
|
|
79
|
+
Run a command list and return the full result dict from cmd.run_all.
|
|
80
|
+
"""
|
|
81
|
+
return __salt__["cmd.run_all"](cmd, python_shell=False)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def start(name, **_):
|
|
85
|
+
"""
|
|
86
|
+
Start the named service.
|
|
87
|
+
|
|
88
|
+
CLI Example:
|
|
89
|
+
|
|
90
|
+
.. code-block:: bash
|
|
91
|
+
|
|
92
|
+
salt '*' service.start <service name>
|
|
93
|
+
"""
|
|
94
|
+
ret = _run(["rc-service", name, "start"])
|
|
95
|
+
return ret["retcode"] == 0
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
def stop(name, **_):
|
|
99
|
+
"""
|
|
100
|
+
Stop the named service.
|
|
101
|
+
|
|
102
|
+
CLI Example:
|
|
103
|
+
|
|
104
|
+
.. code-block:: bash
|
|
105
|
+
|
|
106
|
+
salt '*' service.stop <service name>
|
|
107
|
+
"""
|
|
108
|
+
ret = _run(["rc-service", name, "stop"])
|
|
109
|
+
return ret["retcode"] == 0
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
def restart(name, **_):
|
|
113
|
+
"""
|
|
114
|
+
Restart the named service.
|
|
115
|
+
|
|
116
|
+
CLI Example:
|
|
117
|
+
|
|
118
|
+
.. code-block:: bash
|
|
119
|
+
|
|
120
|
+
salt '*' service.restart <service name>
|
|
121
|
+
"""
|
|
122
|
+
ret = _run(["rc-service", name, "restart"])
|
|
123
|
+
return ret["retcode"] == 0
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
def reload_(name, **_):
|
|
127
|
+
"""
|
|
128
|
+
Send a reload signal to the named service. Not all services support
|
|
129
|
+
reload; consult the service's init script to confirm.
|
|
130
|
+
|
|
131
|
+
CLI Example:
|
|
132
|
+
|
|
133
|
+
.. code-block:: bash
|
|
134
|
+
|
|
135
|
+
salt '*' service.reload <service name>
|
|
136
|
+
"""
|
|
137
|
+
ret = _run(["rc-service", name, "reload"])
|
|
138
|
+
return ret["retcode"] == 0
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
def status(name, sig=None, **_): # pylint: disable=unused-argument
|
|
142
|
+
"""
|
|
143
|
+
Return True if the named service is running, False otherwise.
|
|
144
|
+
|
|
145
|
+
The sig parameter is accepted for interface compatibility with Salt's
|
|
146
|
+
generic service state but is not used; rc-service status is authoritative.
|
|
147
|
+
|
|
148
|
+
CLI Example:
|
|
149
|
+
|
|
150
|
+
.. code-block:: bash
|
|
151
|
+
|
|
152
|
+
salt '*' service.status <service name>
|
|
153
|
+
"""
|
|
154
|
+
ret = _run(["rc-service", name, "status"])
|
|
155
|
+
return ret["retcode"] == 0
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
def enabled(name, runlevel=None, **_):
|
|
159
|
+
"""
|
|
160
|
+
Return True if the named service is enabled in the given runlevel.
|
|
161
|
+
|
|
162
|
+
runlevel
|
|
163
|
+
The runlevel to check. Defaults to 'default'.
|
|
164
|
+
|
|
165
|
+
CLI Example:
|
|
166
|
+
|
|
167
|
+
.. code-block:: bash
|
|
168
|
+
|
|
169
|
+
salt '*' service.enabled <service name>
|
|
170
|
+
salt '*' service.enabled <service name> runlevel=boot
|
|
171
|
+
"""
|
|
172
|
+
runlevel = runlevel or _DEFAULT_RUNLEVEL
|
|
173
|
+
return name in get_enabled(runlevel=runlevel)
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
def disabled(name, **kwargs):
|
|
177
|
+
"""
|
|
178
|
+
Return True if the named service is disabled in the default runlevel.
|
|
179
|
+
|
|
180
|
+
CLI Example:
|
|
181
|
+
|
|
182
|
+
.. code-block:: bash
|
|
183
|
+
|
|
184
|
+
salt '*' service.disabled <service name>
|
|
185
|
+
"""
|
|
186
|
+
return not enabled(name, **kwargs)
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
def enable(name, runlevel=None, **_):
|
|
190
|
+
"""
|
|
191
|
+
Enable the named service in the given runlevel so it starts at boot.
|
|
192
|
+
|
|
193
|
+
runlevel
|
|
194
|
+
The runlevel to add the service to. Defaults to 'default'.
|
|
195
|
+
|
|
196
|
+
CLI Example:
|
|
197
|
+
|
|
198
|
+
.. code-block:: bash
|
|
199
|
+
|
|
200
|
+
salt '*' service.enable <service name>
|
|
201
|
+
salt '*' service.enable <service name> runlevel=boot
|
|
202
|
+
"""
|
|
203
|
+
runlevel = runlevel or _DEFAULT_RUNLEVEL
|
|
204
|
+
ret = _run(["rc-update", "add", name, runlevel])
|
|
205
|
+
return ret["retcode"] == 0
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
def disable(name, runlevel=None, **_):
|
|
209
|
+
"""
|
|
210
|
+
Disable the named service in the given runlevel.
|
|
211
|
+
|
|
212
|
+
runlevel
|
|
213
|
+
The runlevel to remove the service from. Defaults to 'default'.
|
|
214
|
+
|
|
215
|
+
CLI Example:
|
|
216
|
+
|
|
217
|
+
.. code-block:: bash
|
|
218
|
+
|
|
219
|
+
salt '*' service.disable <service name>
|
|
220
|
+
salt '*' service.disable <service name> runlevel=boot
|
|
221
|
+
"""
|
|
222
|
+
runlevel = runlevel or _DEFAULT_RUNLEVEL
|
|
223
|
+
ret = _run(["rc-update", "del", name, runlevel])
|
|
224
|
+
return ret["retcode"] == 0
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
def available(name, **_):
|
|
228
|
+
"""
|
|
229
|
+
Return True if the named service exists on the system.
|
|
230
|
+
|
|
231
|
+
CLI Example:
|
|
232
|
+
|
|
233
|
+
.. code-block:: bash
|
|
234
|
+
|
|
235
|
+
salt '*' service.available <service name>
|
|
236
|
+
"""
|
|
237
|
+
return name in get_all()
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
def missing(name, **_):
|
|
241
|
+
"""
|
|
242
|
+
Return True if the named service is not available on the system.
|
|
243
|
+
|
|
244
|
+
CLI Example:
|
|
245
|
+
|
|
246
|
+
.. code-block:: bash
|
|
247
|
+
|
|
248
|
+
salt '*' service.missing <service name>
|
|
249
|
+
"""
|
|
250
|
+
return not available(name)
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
def get_all(**_):
|
|
254
|
+
"""
|
|
255
|
+
Return a sorted list of all services known to rc-service.
|
|
256
|
+
|
|
257
|
+
CLI Example:
|
|
258
|
+
|
|
259
|
+
.. code-block:: bash
|
|
260
|
+
|
|
261
|
+
salt '*' service.get_all
|
|
262
|
+
"""
|
|
263
|
+
ret = _run(["rc-service", "--list"])
|
|
264
|
+
if ret["retcode"] != 0:
|
|
265
|
+
raise CommandExecutionError(
|
|
266
|
+
"Failed to list services",
|
|
267
|
+
info={"stderr": ret.get("stderr", ""), "stdout": ret.get("stdout", "")},
|
|
268
|
+
)
|
|
269
|
+
return sorted(line.strip() for line in ret["stdout"].splitlines() if line.strip())
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
def get_enabled(runlevel=None, **_):
|
|
273
|
+
"""
|
|
274
|
+
Return a sorted list of services enabled in the given runlevel.
|
|
275
|
+
|
|
276
|
+
runlevel
|
|
277
|
+
The runlevel to query. Defaults to 'default'.
|
|
278
|
+
|
|
279
|
+
CLI Example:
|
|
280
|
+
|
|
281
|
+
.. code-block:: bash
|
|
282
|
+
|
|
283
|
+
salt '*' service.get_enabled
|
|
284
|
+
salt '*' service.get_enabled runlevel=boot
|
|
285
|
+
"""
|
|
286
|
+
runlevel = runlevel or _DEFAULT_RUNLEVEL
|
|
287
|
+
ret = _run(["rc-update", "show", runlevel])
|
|
288
|
+
if ret["retcode"] != 0:
|
|
289
|
+
raise CommandExecutionError(
|
|
290
|
+
f"Failed to list enabled services for runlevel '{runlevel}'",
|
|
291
|
+
info={"stderr": ret.get("stderr", ""), "stdout": ret.get("stdout", "")},
|
|
292
|
+
)
|
|
293
|
+
# Each output line is of the form " sshd | default"
|
|
294
|
+
# Lines from rc-update that are not service entries (status messages)
|
|
295
|
+
# do not contain the pipe character, so we filter on that.
|
|
296
|
+
result = []
|
|
297
|
+
for line in ret["stdout"].splitlines():
|
|
298
|
+
if "|" not in line:
|
|
299
|
+
continue
|
|
300
|
+
svc = line.split("|")[0].strip()
|
|
301
|
+
if svc:
|
|
302
|
+
result.append(svc)
|
|
303
|
+
return sorted(result)
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
def get_running(**_):
|
|
307
|
+
"""
|
|
308
|
+
Return a sorted list of services that are currently started.
|
|
309
|
+
|
|
310
|
+
CLI Example:
|
|
311
|
+
|
|
312
|
+
.. code-block:: bash
|
|
313
|
+
|
|
314
|
+
salt '*' service.get_running
|
|
315
|
+
"""
|
|
316
|
+
# rc-status -a shows services across all runlevels with their status.
|
|
317
|
+
# Service lines look like:
|
|
318
|
+
# " sshd [ started ]"
|
|
319
|
+
# Runlevel header lines look like:
|
|
320
|
+
# "Runlevel: default" or "Dynamic Runlevel: hotplugged"
|
|
321
|
+
# We filter for lines that contain "started" and begin with whitespace,
|
|
322
|
+
# which excludes headers and blank lines.
|
|
323
|
+
ret = _run(["rc-status", "--nocolor", "-a"])
|
|
324
|
+
if ret["retcode"] != 0:
|
|
325
|
+
raise CommandExecutionError(
|
|
326
|
+
"Failed to query running services",
|
|
327
|
+
info={"stderr": ret.get("stderr", ""), "stdout": ret.get("stdout", "")},
|
|
328
|
+
)
|
|
329
|
+
result = []
|
|
330
|
+
for line in ret["stdout"].splitlines():
|
|
331
|
+
if line and line[0] == " " and "started" in line:
|
|
332
|
+
svc = line.strip().split()[0]
|
|
333
|
+
result.append(svc)
|
|
334
|
+
return sorted(result)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.0"
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: saltext.openrc
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Salt Extension for managing services via OpenRC
|
|
5
|
+
Author-email: Will Sinatra <durrendal@lambdacreate.com>
|
|
6
|
+
License: Apache Software License
|
|
7
|
+
Project-URL: Homepage, https://github.com/salt-extensions/saltext-openrc
|
|
8
|
+
Project-URL: Documentation, https://salt-extensions.github.io/saltext-openrc/
|
|
9
|
+
Project-URL: Source, https://github.com/salt-extensions/saltext-openrc
|
|
10
|
+
Project-URL: Tracker, https://github.com/salt-extensions/saltext-openrc/issues
|
|
11
|
+
Keywords: salt-extension
|
|
12
|
+
Platform: any
|
|
13
|
+
Classifier: Programming Language :: Python
|
|
14
|
+
Classifier: Programming Language :: Cython
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
22
|
+
Classifier: Development Status :: 4 - Beta
|
|
23
|
+
Classifier: Intended Audience :: Developers
|
|
24
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
25
|
+
Requires-Python: >=3.10
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
License-File: LICENSE
|
|
28
|
+
License-File: NOTICE
|
|
29
|
+
Requires-Dist: salt>=3007
|
|
30
|
+
Provides-Extra: changelog
|
|
31
|
+
Requires-Dist: towncrier==25.8.0; extra == "changelog"
|
|
32
|
+
Provides-Extra: dev
|
|
33
|
+
Requires-Dist: nox[uv]!=2025.05.01,>=2024.3; extra == "dev"
|
|
34
|
+
Requires-Dist: pre-commit>=2.21.0; extra == "dev"
|
|
35
|
+
Provides-Extra: dev-extra
|
|
36
|
+
Requires-Dist: black==26.5.1; extra == "dev-extra"
|
|
37
|
+
Requires-Dist: isort==8.0.1; extra == "dev-extra"
|
|
38
|
+
Requires-Dist: coverage==7.14.3; extra == "dev-extra"
|
|
39
|
+
Provides-Extra: docs
|
|
40
|
+
Requires-Dist: sphinx; extra == "docs"
|
|
41
|
+
Requires-Dist: sphinx-prompt; extra == "docs"
|
|
42
|
+
Requires-Dist: sphinxcontrib-spelling; extra == "docs"
|
|
43
|
+
Requires-Dist: sphinx-copybutton; extra == "docs"
|
|
44
|
+
Requires-Dist: towncrier==25.8.0; extra == "docs"
|
|
45
|
+
Requires-Dist: sphinxcontrib-towncrier; extra == "docs"
|
|
46
|
+
Requires-Dist: myst_parser; extra == "docs"
|
|
47
|
+
Requires-Dist: furo; extra == "docs"
|
|
48
|
+
Requires-Dist: sphinx-inline-tabs; extra == "docs"
|
|
49
|
+
Provides-Extra: docsauto
|
|
50
|
+
Requires-Dist: sphinx-autobuild; extra == "docsauto"
|
|
51
|
+
Provides-Extra: lint
|
|
52
|
+
Requires-Dist: pylint==4.0.4; extra == "lint"
|
|
53
|
+
Provides-Extra: tests
|
|
54
|
+
Requires-Dist: pytest>=7.2.0; extra == "tests"
|
|
55
|
+
Requires-Dist: pytest-salt-factories>=1.0.0; sys_platform == "win32" and extra == "tests"
|
|
56
|
+
Requires-Dist: pytest-salt-factories[docker]>=1.0.0; sys_platform != "win32" and extra == "tests"
|
|
57
|
+
Requires-Dist: pytest-instafail; extra == "tests"
|
|
58
|
+
Dynamic: license-file
|
|
59
|
+
|
|
60
|
+
# Salt Extension for OpenRC
|
|
61
|
+
|
|
62
|
+
Salt Extension for managing services via OpenRC
|
|
63
|
+
|
|
64
|
+
## Security
|
|
65
|
+
|
|
66
|
+
If you discover a security vulnerability, please refer
|
|
67
|
+
to [Salt's security guide][security].
|
|
68
|
+
|
|
69
|
+
## User Documentation
|
|
70
|
+
|
|
71
|
+
For setup and usage instructions, please refer to the
|
|
72
|
+
[User Documentation][docs].
|
|
73
|
+
|
|
74
|
+
## Contributing
|
|
75
|
+
|
|
76
|
+
The saltext-openrc project welcomes contributions from anyone!
|
|
77
|
+
|
|
78
|
+
The [Salt Extensions guide][salt-extensions-guide] provides comprehensive instructions on all aspects
|
|
79
|
+
of Salt extension development, including [writing tests][writing-tests], [running tests][running-tests],
|
|
80
|
+
[writing documentation][writing-docs] and [rendering the docs][rendering-docs].
|
|
81
|
+
|
|
82
|
+
### Quickstart
|
|
83
|
+
|
|
84
|
+
To get started contributing, first clone this repository (or your fork):
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
# Clone the repo
|
|
88
|
+
git clone --origin upstream git@github.com:salt-extensions/saltext-openrc.git
|
|
89
|
+
|
|
90
|
+
# Change to the repo dir
|
|
91
|
+
cd saltext-openrc
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
#### Automatic
|
|
95
|
+
If you have installed [direnv][direnv], copying the included `.envrc.example` to `.envrc` and
|
|
96
|
+
allowing it to run ensures a proper development environment is present and the virtual environment is active.
|
|
97
|
+
|
|
98
|
+
Without `direnv`, you can still run the automation explicitly:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
make dev # or python3 tools/initialize.py
|
|
102
|
+
source .venv/bin/activate
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
#### Manual
|
|
106
|
+
Please follow the [first steps][first-steps], skipping the repository initialization and first commit.
|
|
107
|
+
|
|
108
|
+
### Pull request
|
|
109
|
+
|
|
110
|
+
Always make changes in a feature branch:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
git switch -c my-feature-branch
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Please ensure you include a [news fragment](https://salt-extensions.github.io/salt-extension-copier/topics/documenting/changelog.html#procedure)
|
|
117
|
+
describing your changes. This is a requirement for all user-facing changes (bug fixes, new features),
|
|
118
|
+
with the exception of documentation changes.
|
|
119
|
+
|
|
120
|
+
To [submit a Pull Request][submitting-pr], you'll need a fork of this repository in
|
|
121
|
+
your own GitHub account. If you followed the instructions above,
|
|
122
|
+
set your fork as the `origin` remote now:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
git remote add origin git@github.com:<your_fork>.git
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Ensure you followed the [first steps][first-steps] and commit your changes, fixing any
|
|
129
|
+
failing `pre-commit` hooks. Then push the feature branch to your fork and submit a PR.
|
|
130
|
+
|
|
131
|
+
### Ways to contribute
|
|
132
|
+
|
|
133
|
+
Contributions come in many forms, and they’re all valuable! Here are some ways you can help
|
|
134
|
+
without writing code:
|
|
135
|
+
|
|
136
|
+
* **Documentation**: Especially examples showing how to use this project
|
|
137
|
+
to solve specific problems.
|
|
138
|
+
* **Triaging issues**: Help manage [issues][issues] and participate in [discussions][discussions].
|
|
139
|
+
* **Reviewing [Pull Requests][PRs]**: We especially appreciate reviews using [Conventional Comments][comments].
|
|
140
|
+
|
|
141
|
+
You can also contribute by:
|
|
142
|
+
|
|
143
|
+
* Writing blog posts
|
|
144
|
+
* Sharing your experiences using Salt + OpenRC
|
|
145
|
+
on social media
|
|
146
|
+
* Giving talks at conferences
|
|
147
|
+
* Publishing videos
|
|
148
|
+
* Engaging in IRC, Discord or email groups
|
|
149
|
+
|
|
150
|
+
Any of these things are super valuable to our community, and we sincerely
|
|
151
|
+
appreciate every contribution!
|
|
152
|
+
|
|
153
|
+
[security]: https://github.com/saltstack/salt/blob/master/SECURITY.md
|
|
154
|
+
[salt-extensions-guide]: https://salt-extensions.github.io/salt-extension-copier/
|
|
155
|
+
[writing-tests]: https://salt-extensions.github.io/salt-extension-copier/topics/testing/writing.html
|
|
156
|
+
[running-tests]: https://salt-extensions.github.io/salt-extension-copier/topics/testing/running.html
|
|
157
|
+
[writing-docs]: https://salt-extensions.github.io/salt-extension-copier/topics/documenting/writing.html
|
|
158
|
+
[rendering-docs]: https://salt-extensions.github.io/salt-extension-copier/topics/documenting/building.html
|
|
159
|
+
[first-steps]: https://salt-extensions.github.io/salt-extension-copier/topics/creation.html#initialize-the-python-virtual-environment
|
|
160
|
+
[submitting-pr]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork
|
|
161
|
+
[direnv]: https://direnv.net
|
|
162
|
+
[issues]: https://github.com/salt-extensions/saltext-openrc/issues
|
|
163
|
+
[PRs]: https://github.com/salt-extensions/saltext-openrc/pulls
|
|
164
|
+
[discussions]: https://github.com/salt-extensions/saltext-openrc/discussions
|
|
165
|
+
[comments]: https://conventionalcomments.org/
|
|
166
|
+
[docs]: https://salt-extensions.github.io/saltext-openrc/
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
saltext/openrc/__init__.py,sha256=D7LywTuuKOLBckMpBTKjqwuIS6PABYTo1qDO2n02Vus,863
|
|
2
|
+
saltext/openrc/version.py,sha256=kUR5RAFc7HCeiqdlX36dZOHkUI5wI6V_43RpEcD8b-0,22
|
|
3
|
+
saltext/openrc/modules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
+
saltext/openrc/modules/openrc.py,sha256=KH6TEmIvKYJFQCnxFeL7OnVgvedW4295z4ZCstUF-4s,9202
|
|
5
|
+
saltext_openrc-0.1.0.dist-info/licenses/LICENSE,sha256=mbpbcDAn_pPJuPfSQuXgJ2BlG8o9si5GySJe65pH3Ug,11342
|
|
6
|
+
saltext_openrc-0.1.0.dist-info/licenses/NOTICE,sha256=n9pSAb0P_23LPKPFLx3RHsn8TPdQ-IWy0-_CTJOpZkE,455
|
|
7
|
+
saltext_openrc-0.1.0.dist-info/METADATA,sha256=0sSNe40gDD0jL3SnCAMjX2VyNF1jufANLsxq8EhH-1k,6790
|
|
8
|
+
saltext_openrc-0.1.0.dist-info/WHEEL,sha256=4YBfCYNH4wlLpv3pzq1hbEuIlXA4WJabKLFurZ7eTL0,109
|
|
9
|
+
saltext_openrc-0.1.0.dist-info/entry_points.txt,sha256=yneUggyO4jd9Z5eublRy0PVleFcmPjdBsYoYPdV1Qmw,46
|
|
10
|
+
saltext_openrc-0.1.0.dist-info/top_level.txt,sha256=6cynQgWBWnAPoXMnUaVitGzM6k7PzacwjLBPgrjOfi4,8
|
|
11
|
+
saltext_openrc-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Will Sinatra
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Salt Extension Modules for OpenRC
|
|
2
|
+
Copyright 2026 Will Sinatra
|
|
3
|
+
|
|
4
|
+
This product is licensed to you under the Apache 2.0 license (the "License").
|
|
5
|
+
You may not use this product except in compliance with the Apache 2.0 License.
|
|
6
|
+
|
|
7
|
+
This product may include a number of subcomponents with separate copyright
|
|
8
|
+
notices and license terms. Your use of these subcomponents is subject to the
|
|
9
|
+
terms and conditions of the subcomponent's license, as noted in the LICENSE
|
|
10
|
+
file.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
saltext
|