Note: new API, srx_get_bool() returns -1 on error, leaving 0 and 1 as
false and true, respectively.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Unfortunately, sysrepo considers it an error to load a module that is
already loaded, ruling out using `sr_install_modules`.
Therefore, provide `require_modules` instead, which ensures that a
given set of modules are loaded, or loads them otherwise.
Things we really want later, but don't use right now:
- MRP
- MSTP
Neat to have in a networking product, but not used at all by us atm:
- ttyd
- tmux
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Add the ability to set and delete system MotD (Message Of The Day)
using the cli.
This patch augments the standard ietf-system yang schema with
a new infix-system schema which contains a new motd leaf.
The default value is hard coded in two places, confd and the rootfs
file /etc/motd. The intention is to fix this in upcoming patches.
Introduces:
exec> configure> set system motd STRING
exec> configure> delete system motd
This is needed to confirm the new system configuration generation and
reload all affected services. E.g., when configuring an NTP server
and committing the candidate to running, the ietf-system plugin has
only enabled the service, as a last step we need to tell Finit to
actually start it.
This hook needs to run last since the enabled service(s) may depend on
other service(s), or networking, to be enabled in the proper order.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Really ugly handling here, needs to be reworked into sr_uint8() etc.,
adding as-is for big upcoming demo.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Declare deviation for /ietf-system:system/clock/timezone-utc-offset,
which we currently do not support.
Please note, when setting out to add support for timezone-utc-offset,
you need to ensure the user does not input both, that should be a
validation error. It's an either-or thing.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
How to verify, use the following command and paste the XML below:
$ sysrepocfg -R
<sys:set-current-datetime xmlns:sys="urn:ietf:params:xml:ns:yang:ietf-system">
<sys:current-datetime>2022-01-12T14:29:00-02:00</sys:current-datetime>
</sys:set-current-datetime>
Reuse code from mech, verified and working.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
When researching the systemd tmpfiles.d implementation I discovered the
effort to standarize on /usr/share/factory as a generic factory defaults
for Linux systems. This patch adds a small example factory.cfg file
that is installed as /usr/share/factory/cfg/startup-config.cfg. The
tmpfiles.d backend will then install it as /cfg/startup-config.cfg if
that file is missing at boot. Confd does the rest to bootstrap our
(by default) empty sysrepo db with this startup-config.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>