__systemd_resolved: initial implementation.
This commit is contained in:
parent
9a779aafa3
commit
f6d0cbbeb7
3 changed files with 110 additions and 0 deletions
21
type/__systemd_resolved/gencode-remote
Executable file
21
type/__systemd_resolved/gencode-remote
Executable file
|
@ -0,0 +1,21 @@
|
||||||
|
#!/bin/sh -e
|
||||||
|
#
|
||||||
|
# 2022 Joachim Desroches (joachim.desroches@epfl.ch)
|
||||||
|
#
|
||||||
|
# This file is part of cdist.
|
||||||
|
#
|
||||||
|
# cdist is free software: 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 is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
|
||||||
|
echo "systemctl enable systemd-resolved"
|
47
type/__systemd_resolved/man.rst
Normal file
47
type/__systemd_resolved/man.rst
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
cdist-type__systemd_resolved(7)
|
||||||
|
===============================
|
||||||
|
|
||||||
|
NAME
|
||||||
|
----
|
||||||
|
cdist-type__systemd_resolved - Configure system to use systemd-resolved.
|
||||||
|
|
||||||
|
|
||||||
|
DESCRIPTION
|
||||||
|
-----------
|
||||||
|
*systemd-resolved* is a systemd service that provides network name resolution
|
||||||
|
to local applications via a D-Bus interface, the resolve NSS service
|
||||||
|
(nss-resolve(8)), and a local DNS stub listener on 127.0.0.53.
|
||||||
|
|
||||||
|
This type enables and starts this type, and helps with some minimal
|
||||||
|
configuration. In particular, systemd-resolved has four modes of handling the
|
||||||
|
`/etc/resolv.conf` file: stub, static, uplink and foreign. See the
|
||||||
|
systemd-resolved(8) manpage for details. By default, this type uses stub mode:
|
||||||
|
if you need another one, please provide an implementation in this type!
|
||||||
|
|
||||||
|
|
||||||
|
EXAMPLES
|
||||||
|
--------
|
||||||
|
|
||||||
|
.. code-block:: sh
|
||||||
|
|
||||||
|
__systemd_resolved
|
||||||
|
|
||||||
|
|
||||||
|
SEE ALSO
|
||||||
|
--------
|
||||||
|
`systemd.network`\ (5)
|
||||||
|
`systemd-resolved`\ (8)
|
||||||
|
`nss-resolve`\ (8)
|
||||||
|
|
||||||
|
|
||||||
|
AUTHORS
|
||||||
|
-------
|
||||||
|
Joachim Desroches <joachim.desroches@epfl.ch>
|
||||||
|
|
||||||
|
|
||||||
|
COPYING
|
||||||
|
-------
|
||||||
|
Copyright \(C) 2022 Joachim Desroches. 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.
|
42
type/__systemd_resolved/manifest
Executable file
42
type/__systemd_resolved/manifest
Executable file
|
@ -0,0 +1,42 @@
|
||||||
|
#!/bin/sh -e
|
||||||
|
#
|
||||||
|
# 2022 Joachim Desroches (joachim.desroches@epfl.ch)
|
||||||
|
#
|
||||||
|
# This file is part of cdist.
|
||||||
|
#
|
||||||
|
# cdist is free software: 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 is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
|
||||||
|
os=$(cat "${__global:?}/explorer/os")
|
||||||
|
|
||||||
|
case "$os" in
|
||||||
|
'debian')
|
||||||
|
:
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
printf "Your operating system (%s) is currently not supported by __systemd_resolved\n" "$os" >&2
|
||||||
|
printf "Please contribute an implementation for it if you can.\n" >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
__link /etc/resolv.conf \
|
||||||
|
--type symbolic \
|
||||||
|
--source ../run/systemd/resolve/stub-resolv.conf
|
||||||
|
|
||||||
|
require=__link/etc/resolv.conf \
|
||||||
|
__systemd_service systemd-resolved \
|
||||||
|
--state running \
|
||||||
|
--action restart \
|
||||||
|
--if-required
|
Loading…
Reference in a new issue